<html>
<head><meta charset="utf-8"><title>intptrcast model · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html">intptrcast model</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167432194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167432194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167432194">(Jun 05 2019 at 21:32)</a>:</h4>
<p>This is just for disccussing <a href="https://github.com/rust-lang/miri/issues/224" target="_blank" title="https://github.com/rust-lang/miri/issues/224">https://github.com/rust-lang/miri/issues/224</a></p>



<a name="167433096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167433096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167433096">(Jun 05 2019 at 21:47)</a>:</h4>
<p>So based on <span class="user-mention" data-user-id="124288">@oli</span> instructions, the <code>int_to_ptr</code> method in <code>Machine</code> should be something like this:</p>



<a name="167433143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167433143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167433143">(Jun 05 2019 at 21:48)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="k">fn</span> <span class="nf">int_to_ptr</span><span class="p">(</span><span class="n">scalar</span>: <span class="nc">Scalar</span><span class="o">&lt;</span><span class="n">Self</span>::<span class="n">PointerTag</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">extra</span>: <span class="kp">&amp;</span><span class="nc">Self</span>::<span class="n">MemoryExtra</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">EvalResult</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="p">,</span><span class="w"> </span><span class="n">Pointer</span><span class="o">&lt;</span><span class="n">Self</span>::<span class="n">PointerTag</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">match</span><span class="w"> </span><span class="n">scalar</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">Scalar</span>::<span class="n">Ptr</span><span class="p">(</span><span class="n">ptr</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="nb">Ok</span><span class="p">(</span><span class="n">ptr</span><span class="p">),</span><span class="w"></span>
<span class="w">            </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="nb">Err</span><span class="p">(</span><span class="n">EvalError</span>::<span class="n">from</span><span class="p">(</span><span class="n">InterpError</span>::<span class="n">ReadBytesAsPointer</span><span class="p">))</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="167433267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167433267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167433267">(Jun 05 2019 at 21:50)</a>:</h4>
<p>But then, based on my recent discussion with <span class="user-mention" data-user-id="120791">@RalfJ</span> , this  method should take an <code>u64</code>. So what should happen here? Because following the same logic would always return an error, i.e., if i use <code>Scalar::from_uint</code> to generate a scalar, it will be a <code>Scalar::Raw</code>.</p>



<a name="167433319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167433319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167433319">(Jun 05 2019 at 21:51)</a>:</h4>
<p>and then, what should happen with <code>ptr_to_int</code>, should it return a <code>Scalar</code> or an <code>u64</code>?</p>



<a name="167456587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167456587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167456587">(Jun 06 2019 at 06:47)</a>:</h4>
<p>I can't find the discussion on <code>int_to_ptr</code> taking <code>u64</code>. I would have thought the above to be the correct way for const eval to implement <code>int_to_ptr</code> and I don't see how we could do this otherwise without duplicating the above <code>match</code> in a lot of places</p>



<a name="167460005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167460005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167460005">(Jun 06 2019 at 07:56)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  so my plan was to have operations <code>force_bits</code> and <code>force_ptr</code> in the <code>InterpCtx</code> that have type <code>Scalar -&gt; u128</code> and <code>Scalar -&gt; Pointer</code>, respectively. They would be used instead of <code>to_bits</code> and <code>to_ptr</code></p>



<a name="167460027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167460027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167460027">(Jun 06 2019 at 07:57)</a>:</h4>
<p>and those are implemented using new machine hooks <code>int_to_ptr</code> and <code>ptr_to_int</code> with types <code>u64 -&gt; Pointer</code> and <code>Pointer -&gt; u64</code></p>



<a name="167460032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167460032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167460032">(Jun 06 2019 at 07:57)</a>:</h4>
<p>an operation called <code>int_to_ptr</code> IMO should have type int-to-ptr, or else something is off ;)</p>



<a name="167460086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167460086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167460086">(Jun 06 2019 at 07:58)</a>:</h4>
<p>and your suggested <code>ptr_to_int</code> had return type <code>Scalar</code> which is annoying because it means every caller still needs to do <code>to_bits</code></p>



<a name="167460100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167460100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167460100">(Jun 06 2019 at 07:58)</a>:</h4>
<p>and moreover every caller would have to duplicate the match because really the operation we want is <code>Scalar -&gt; u128</code></p>



<a name="167469574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167469574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167469574">(Jun 06 2019 at 10:29)</a>:</h4>
<p>Right, that makes sense. So the machine hook for const eval would just ignore all its arguments and return the error</p>



<a name="167470987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167470987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167470987">(Jun 06 2019 at 10:55)</a>:</h4>
<p>both of them, yes</p>



<a name="167483180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167483180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167483180">(Jun 06 2019 at 13:52)</a>:</h4>
<p>Ohh OK, I'll do that then</p>



<a name="167484096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167484096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167484096">(Jun 06 2019 at 14:03)</a>:</h4>
<p>I'll try to do the same replacements I had before and I'll write you if I get stuck</p>



<a name="167484205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167484205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167484205">(Jun 06 2019 at 14:04)</a>:</h4>
<p>as a first step you could just move the <code>to_bits</code> and <code>to_ptr</code> functions to <code>InterpCx</code> without touching <code>Machine</code> at all</p>



<a name="167484221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167484221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167484221">(Jun 06 2019 at 14:04)</a>:</h4>
<p>the diffs should get much simpler afterwards ^^</p>



<a name="167487459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167487459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167487459">(Jun 06 2019 at 14:39)</a>:</h4>
<p>I decided to reset the branch :P</p>



<a name="167487515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167487515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167487515">(Jun 06 2019 at 14:39)</a>:</h4>
<p>i decided to reset the branch (I opened a new topic by accident)</p>



<a name="167488913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167488913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167488913">(Jun 06 2019 at 14:55)</a>:</h4>
<p>wow that seems drastic^^</p>



<a name="167489058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167489058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167489058">(Jun 06 2019 at 14:56)</a>:</h4>
<p>hahaha maybe it is</p>



<a name="167489961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167489961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167489961">(Jun 06 2019 at 15:05)</a>:</h4>
<p>So, <code>force_bits</code> would take a <code>Scalar</code>, how can I get an <code>u128</code> from it using the new methods from <code>Machine</code>?, just call <code>int_to_ptr</code> and then <code>ptr_to_int</code>?</p>



<a name="167490638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490638">(Jun 06 2019 at 15:12)</a>:</h4>
<p>I am confused</p>



<a name="167490656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490656">(Jun 06 2019 at 15:13)</a>:</h4>
<p><code>int_to_ptr</code> should <em>take</em> a <code>u64</code> or <code>u128</code> so that won't help^^</p>



<a name="167490695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490695">(Jun 06 2019 at 15:13)</a>:</h4>
<p>so. We have <code>int_to_ptr</code> and <code>ptr_to_int</code></p>



<a name="167490703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490703">(Jun 06 2019 at 15:13)</a>:</h4>
<p>those are in <code>Machine</code></p>



<a name="167490705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490705">(Jun 06 2019 at 15:13)</a>:</h4>
<p>you have this: <a href="https://github.com/rust-lang/rust/blob/8b36867093fb774bcbd9f787cbc470a5f44c1310/src/librustc/mir/interpret/value.rs#L305" target="_blank" title="https://github.com/rust-lang/rust/blob/8b36867093fb774bcbd9f787cbc470a5f44c1310/src/librustc/mir/interpret/value.rs#L305">https://github.com/rust-lang/rust/blob/8b36867093fb774bcbd9f787cbc470a5f44c1310/src/librustc/mir/interpret/value.rs#L305</a></p>



<a name="167490724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490724">(Jun 06 2019 at 15:14)</a>:</h4>
<p>then you can <code>match</code> on the result and either you already got a <code>u128</code> or you call <code>ptr_to_int</code></p>



<a name="167490772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490772">(Jun 06 2019 at 15:14)</a>:</h4>
<p>ohhh</p>



<a name="167490775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490775">(Jun 06 2019 at 15:14)</a>:</h4>
<p>thats evil</p>



<a name="167490779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490779">(Jun 06 2019 at 15:14)</a>:</h4>
<p>ok</p>



<a name="167490786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490786">(Jun 06 2019 at 15:14)</a>:</h4>
<p><code>force_bits</code> calling <code>int_to_ptr</code> makes no sense, does it?</p>



<a name="167490792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490792">(Jun 06 2019 at 15:14)</a>:</h4>
<p>why evil?^^</p>



<a name="167490807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490807">(Jun 06 2019 at 15:14)</a>:</h4>
<p>and i guess i should cast the <code>u64</code> to <code>u128</code></p>



<a name="167490838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167490838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167490838">(Jun 06 2019 at 15:15)</a>:</h4>
<blockquote>
<p>why evil?^^</p>
</blockquote>
<p>I was biased to not use the methods from <code>Scalar</code> directly for some reason :P</p>



<a name="167491115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167491115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167491115">(Jun 06 2019 at 15:18)</a>:</h4>
<blockquote>
<p>and i guess i should cast the <code>u64</code> to <code>u128</code></p>
</blockquote>
<p>yes</p>



<a name="167491163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167491163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167491163">(Jun 06 2019 at 15:18)</a>:</h4>
<p>hm actually there is a good question here</p>



<a name="167491183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167491183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167491183">(Jun 06 2019 at 15:18)</a>:</h4>
<p>one testcase should do something like <code>... as *const i32 as usize as u8 as usize</code> and make sure the value got truncated</p>



<a name="167491230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167491230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167491230">(Jun 06 2019 at 15:19)</a>:</h4>
<p>I haven't looked at the cast code yet so I am not sure if it does the right thing there</p>



<a name="167491840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167491840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167491840">(Jun 06 2019 at 15:25)</a>:</h4>
<p>we currently error in a cast of a pointer value to <code>u8</code>, so that's good</p>



<a name="167492740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167492740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167492740">(Jun 06 2019 at 15:35)</a>:</h4>
<p>but <code>*const i32 as usize</code> shouldn't truncate anything i guess, just the <code>as u8</code> should</p>



<a name="167493555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167493555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167493555">(Jun 06 2019 at 15:42)</a>:</h4>
<p>ok it is done</p>



<a name="167493558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167493558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167493558">(Jun 06 2019 at 15:42)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...christianpoveda:intptrcast-model" target="_blank" title="https://github.com/rust-lang/rust/compare/master...christianpoveda:intptrcast-model">https://github.com/rust-lang/rust/compare/master...christianpoveda:intptrcast-model</a></p>



<a name="167493575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167493575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167493575">(Jun 06 2019 at 15:42)</a>:</h4>
<p>what do you think?</p>



<a name="167496046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167496046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167496046">(Jun 06 2019 at 16:10)</a>:</h4>
<p>I moved the  <code>force</code> methods to <code>Memory</code> but added hooks in <code>InterpretCx</code></p>



<a name="167517637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167517637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167517637">(Jun 06 2019 at 20:06)</a>:</h4>
<p>I've been replacing <code>to_ptr</code> by <code>force_ptr</code> and most of the time it causes UB or ends up with the following error when compiling <code>rustc</code>:</p>
<div class="codehilite"><pre><span></span> a raw memory access tried to access part of a pointer value as raw bytes
</pre></div>



<a name="167557541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167557541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167557541">(Jun 07 2019 at 08:22)</a>:</h4>
<p>please leave a comment on GH asking for review, I cant look at it right now and Zulip notifications are to ephemeral</p>



<a name="167557551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167557551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167557551">(Jun 07 2019 at 08:23)</a>:</h4>
<p>emails are much better, I can actually organize them in a way that I can remember to get back to you ;)</p>



<a name="167571180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167571180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167571180">(Jun 07 2019 at 12:19)</a>:</h4>
<p>Sure!</p>



<a name="167594402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167594402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167594402">(Jun 07 2019 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> I apologize in advance for the conflicts <a href="https://github.com/rust-lang/rust/pull/61625" target="_blank" title="https://github.com/rust-lang/rust/pull/61625">https://github.com/rust-lang/rust/pull/61625</a> is going to cause you :(</p>



<a name="167598506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167598506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167598506">(Jun 07 2019 at 17:58)</a>:</h4>
<p>Don't worry, I knew I had to resolve merge conflicts on this one eventually :P</p>



<a name="167726158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167726158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167726158">(Jun 10 2019 at 01:34)</a>:</h4>
<p>Just passing through, but I recently ran into some issues casting pointers (<a href="#narrow/stream/131828-t-compiler/topic/function.20pointers.20and.20address.20spaces" title="#narrow/stream/131828-t-compiler/topic/function.20pointers.20and.20address.20spaces">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/function.20pointers.20and.20address.20spaces</a>) which may or may not be interesting to y'all</p>



<a name="167950500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167950500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167950500">(Jun 12 2019 at 14:10)</a>:</h4>
<p>Should I start working on the miri changes?</p>



<a name="167950834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167950834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167950834">(Jun 12 2019 at 14:14)</a>:</h4>
<p>as commented on the PR I do not believe that miri will be able to pass its test suite after the current state of your PR</p>



<a name="167951168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167951168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167951168">(Jun 12 2019 at 14:18)</a>:</h4>
<p>I just got your review</p>



<a name="167951226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167951226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167951226">(Jun 12 2019 at 14:19)</a>:</h4>
<p>I'm gonna undo the operator changes and fix the size problem</p>



<a name="167951994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167951994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167951994">(Jun 12 2019 at 14:26)</a>:</h4>
<p>compiling <span aria-label="counterclockwise" class="emoji emoji-1f504" role="img" title="counterclockwise">:counterclockwise:</span></p>



<a name="167952575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167952575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167952575">(Jun 12 2019 at 14:32)</a>:</h4>
<p>man i gotta get one of those ryzen cpus, this is taking ages D:</p>



<a name="167953994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167953994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167953994">(Jun 12 2019 at 14:48)</a>:</h4>
<p>where can I get the context for the <code>to_usize</code> call?</p>



<a name="167954005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954005">(Jun 12 2019 at 14:48)</a>:</h4>
<p>it is inside <code>Memory</code></p>



<a name="167954082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954082">(Jun 12 2019 at 14:49)</a>:</h4>
<p>ohhh memory implements hasDataLayout</p>



<a name="167954085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954085">(Jun 12 2019 at 14:49)</a>:</h4>
<p>great</p>



<a name="167954086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954086">(Jun 12 2019 at 14:49)</a>:</h4>
<p>xD</p>



<a name="167954181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954181">(Jun 12 2019 at 14:50)</a>:</h4>
<p>yea, just pass <code>self</code> :D</p>



<a name="167954362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167954362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167954362">(Jun 12 2019 at 14:52)</a>:</h4>
<p>hahahaha yep i'm running tests after the rebase <span aria-label="clock" class="emoji emoji-1f557" role="img" title="clock">:clock:</span></p>



<a name="167959383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167959383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167959383">(Jun 12 2019 at 15:40)</a>:</h4>
<p>i hope that git will believe me that this can be merged</p>



<a name="167959430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167959430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167959430">(Jun 12 2019 at 15:40)</a>:</h4>
<p>I'll have a look tomorrow, going offline for the day</p>



<a name="167959469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/167959469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#167959469">(Jun 12 2019 at 15:41)</a>:</h4>
<p>sure, guten Abend :D (goddamn Tz)</p>



<a name="168062495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168062495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168062495">(Jun 13 2019 at 16:44)</a>:</h4>
<p>I'm going to need a lecture about that last comment</p>



<a name="168062529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168062529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168062529">(Jun 13 2019 at 16:45)</a>:</h4>
<p>i assume pointer sized types should have the same size as <code>usize</code>, right?</p>



<a name="168062983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168062983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168062983">(Jun 13 2019 at 16:51)</a>:</h4>
<p>which comment?</p>



<a name="168063108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063108">(Jun 13 2019 at 16:52)</a>:</h4>
<blockquote>
<p>IOW, the run-tme dispatch on the value here is just as ugly as the similar one in binops. We should dispatch only based on types, not on values... but we cannot yet due to pointers at integer types.</p>
<p>But what we can do is first dispatch based on whether the type is ptr-sized, and if yes proceed like now, and if not do basically self.cast_from_int(self.force_bits(data)).</p>
</blockquote>



<a name="168063449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063449">(Jun 13 2019 at 16:56)</a>:</h4>
<p>that's for later, let's not do these casts now</p>



<a name="168063654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063654">(Jun 13 2019 at 16:58)</a>:</h4>
<p>yep i'm just gonna move the ptr size as a parameter in <code>force_bits</code> and replace <code>to_bits</code> in the places you mentioned</p>



<a name="168063717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063717">(Jun 13 2019 at 16:59)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="168063805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063805">(Jun 13 2019 at 17:00)</a>:</h4>
<p>what's this quote-only comment?^^ <a href="https://github.com/rust-lang/rust/pull/61781#discussion_r293481602" target="_blank" title="https://github.com/rust-lang/rust/pull/61781#discussion_r293481602">https://github.com/rust-lang/rust/pull/61781#discussion_r293481602</a></p>



<a name="168063919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063919">(Jun 13 2019 at 17:01)</a>:</h4>
<p>hahaha, my comment mixed with the quote, fixed it</p>



<a name="168063945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168063945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168063945">(Jun 13 2019 at 17:01)</a>:</h4>
<p>this shouldnt take a lot of time brb</p>



<a name="168064493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064493">(Jun 13 2019 at 17:07)</a>:</h4>
<p>I added the ptr_size as an argument inside ecx also</p>



<a name="168064727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064727">(Jun 13 2019 at 17:09)</a>:</h4>
<p>yes</p>



<a name="168064743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064743">(Jun 13 2019 at 17:09)</a>:</h4>
<p>also the argument is the size, not the ptr size -- the entire point is that it might not be the ptr size ;)</p>



<a name="168064822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064822">(Jun 13 2019 at 17:10)</a>:</h4>
<p>the ptr size is always fixed for every execution, it's either 4 or 8 bytes (currently); the size is the size of <em>this particular value</em></p>



<a name="168064928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064928">(Jun 13 2019 at 17:11)</a>:</h4>
<p>lol</p>



<a name="168064934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168064934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168064934">(Jun 13 2019 at 17:12)</a>:</h4>
<p>if it compiles ill change the name before doing the commit</p>



<a name="168066727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168066727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168066727">(Jun 13 2019 at 17:32)</a>:</h4>
<p>looks great :)</p>



<a name="168072712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168072712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168072712">(Jun 13 2019 at 18:34)</a>:</h4>
<p>yay</p>



<a name="168075180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168075180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168075180">(Jun 13 2019 at 19:00)</a>:</h4>
<p>tests are running <span aria-label="dancing" class="emoji emoji-1f57a" role="img" title="dancing">:dancing:</span></p>



<a name="168075752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168075752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168075752">(Jun 13 2019 at 19:06)</a>:</h4>
<p>time to write some testcases and then do the "real" work on the Miri side? :D</p>



<a name="168076806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168076806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168076806">(Jun 13 2019 at 19:19)</a>:</h4>
<p>we'll see</p>



<a name="168076810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168076810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168076810">(Jun 13 2019 at 19:19)</a>:</h4>
<p>where do we start?</p>



<a name="168140506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140506">(Jun 14 2019 at 14:39)</a>:</h4>
<blockquote>
<p>time to write some testcases and then do the "real" work on the Miri side? :D</p>
</blockquote>
<p>Should I follow <span class="user-mention" data-user-id="124288">@oli</span> steps for the miri side?</p>



<a name="168140606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140606">(Jun 14 2019 at 14:40)</a>:</h4>
<p>/me made steps?</p>



<a name="168140645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140645">(Jun 14 2019 at 14:40)</a>:</h4>
<p>oh, right, I remember now</p>



<a name="168140667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140667">(Jun 14 2019 at 14:40)</a>:</h4>
<p>I think Ralf wants to see tests first and implementation later</p>



<a name="168140815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140815">(Jun 14 2019 at 14:42)</a>:</h4>
<blockquote>
<p>/me made steps?</p>
</blockquote>
<p>maybe it was your inner Mr. Robot or something</p>



<a name="168140831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140831">(Jun 14 2019 at 14:42)</a>:</h4>
<p>ok so tests</p>



<a name="168140853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140853">(Jun 14 2019 at 14:43)</a>:</h4>
<p>I suck at writing tests</p>



<a name="168140864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140864">(Jun 14 2019 at 14:43)</a>:</h4>
<p>Like <code>let x: usize = &amp;42 as *const i32; let y = x &amp; 1; let z = x &gt;&gt; 1; let a = (z &lt;&lt; 1) + y; let b = a as *const i32; let c = unsafe { *b }; assert_eq!(c, 42);</code></p>



<a name="168140894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140894">(Jun 14 2019 at 14:43)</a>:</h4>
<p>I mean the extreme test case would be <code>println!("{:p}", &amp;42);</code></p>



<a name="168140906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140906">(Jun 14 2019 at 14:43)</a>:</h4>
<p>where do miri tests go?</p>



<a name="168140921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168140921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168140921">(Jun 14 2019 at 14:43)</a>:</h4>
<p>in the miri repo</p>



<a name="168141047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141047">(Jun 14 2019 at 14:44)</a>:</h4>
<p>oh the test directory structure is plain, great</p>



<a name="168141106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141106">(Jun 14 2019 at 14:45)</a>:</h4>
<p>I'm going to fork the repo and start playing with it a little bit</p>



<a name="168141319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141319">(Jun 14 2019 at 14:47)</a>:</h4>
<p>ah</p>



<a name="168141327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141327">(Jun 14 2019 at 14:47)</a>:</h4>
<p>you can do that inside your rustc checkout</p>



<a name="168141378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141378">(Jun 14 2019 at 14:48)</a>:</h4>
<p><code>./x.py test src/tools/miri</code></p>



<a name="168141388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141388">(Jun 14 2019 at 14:48)</a>:</h4>
<p>there's a full miri checkout in there</p>



<a name="168141415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141415">(Jun 14 2019 at 14:48)</a>:</h4>
<p>or maybe use your custom checkout and follow the instructions in the miri repo</p>



<a name="168141431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141431">(Jun 14 2019 at 14:49)</a>:</h4>
<p>you can create a <code>rustup toolchain</code> for your locally built rustc</p>



<a name="168141584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141584">(Jun 14 2019 at 14:50)</a>:</h4>
<p>ok this is new ground</p>



<a name="168141669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141669">(Jun 14 2019 at 14:51)</a>:</h4>
<p>mmm... So i can run the miri tests from <code>x.py</code></p>



<a name="168141748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141748">(Jun 14 2019 at 14:52)</a>:</h4>
<p>but my changes to the miri repo shouldnt be in my fork and then do a PR against the <code>rust-lang/miri</code> repo?</p>



<a name="168141853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141853">(Jun 14 2019 at 14:54)</a>:</h4>
<p>no</p>



<a name="168141899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141899">(Jun 14 2019 at 14:54)</a>:</h4>
<p>in your fork against the miri repo</p>



<a name="168141939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141939">(Jun 14 2019 at 14:54)</a>:</h4>
<blockquote>
<p>in your fork against the miri repo</p>
</blockquote>
<p>oh yeah sorry i meant <code>rust-lang/miri</code> repo</p>



<a name="168141977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141977">(Jun 14 2019 at 14:55)</a>:</h4>
<p>right, a branch in your fork, and PR against <code>rust-lang/miri</code></p>



<a name="168141996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168141996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168141996">(Jun 14 2019 at 14:55)</a>:</h4>
<p>but then how can I replace the <code>miri</code> repo inside the <code>rustc</code> repo by my fork?</p>



<a name="168142009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142009">(Jun 14 2019 at 14:55)</a>:</h4>
<p>aaah</p>



<a name="168142070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142070">(Jun 14 2019 at 14:56)</a>:</h4>
<p>heh, no need, just <code>git remote add mine your_addr_here</code></p>



<a name="168142080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142080">(Jun 14 2019 at 14:56)</a>:</h4>
<p>and then <code>git push mine branch_name</code></p>



<a name="168142092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142092">(Jun 14 2019 at 14:56)</a>:</h4>
<p>ohh of course</p>



<a name="168142231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142231">(Jun 14 2019 at 14:58)</a>:</h4>
<p>I'm gonna do that, but as you can see my git-fu is not great: <a href="https://github.com/rust-lang/rust/pull/61668" target="_blank" title="https://github.com/rust-lang/rust/pull/61668">https://github.com/rust-lang/rust/pull/61668</a></p>



<a name="168142478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142478">(Jun 14 2019 at 15:01)</a>:</h4>
<p>heh, just ask when you screw up, it's how I learned</p>



<a name="168142494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168142494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168142494">(Jun 14 2019 at 15:01)</a>:</h4>
<p>usually everything is salvageable</p>



<a name="168149168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168149168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168149168">(Jun 14 2019 at 16:15)</a>:</h4>
<p>alternatively you can clone miri and work there locally, the miri README has instructions for that. which style you prefer is a matter of taste I guess^^</p>



<a name="168149338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168149338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168149338">(Jun 14 2019 at 16:18)</a>:</h4>
<p>Ok I added the remotes and nothing blew up</p>



<a name="168149390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168149390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168149390">(Jun 14 2019 at 16:18)</a>:</h4>
<p>:)</p>



<a name="168149396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168149396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168149396">(Jun 14 2019 at 16:18)</a>:</h4>
<p>:D</p>



<a name="168153491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168153491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168153491">(Jun 14 2019 at 17:08)</a>:</h4>
<p>So, rustc is compiling and its going to take a while. Tomorrow I'll tell you what happened to decide which should be good tests</p>



<a name="168157742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168157742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168157742">(Jun 14 2019 at 18:03)</a>:</h4>
<p>It seems like miri is broken due to the Eval -&gt; Interp changes, I'll try to pull when that gets fixed</p>



<a name="168158039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158039">(Jun 14 2019 at 18:07)</a>:</h4>
<p>uh, that got fixed long ago...</p>



<a name="168158052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158052">(Jun 14 2019 at 18:07)</a>:</h4>
<p>miri builds fine with current rustc master</p>



<a name="168158111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158111">(Jun 14 2019 at 18:08)</a>:</h4>
<p>just the miri in rustc hasnt received those updates yet, which might be your problem</p>



<a name="168158127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158127">(Jun 14 2019 at 18:08)</a>:</h4>
<p>ohh damn</p>



<a name="168158136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158136">(Jun 14 2019 at 18:08)</a>:</h4>
<p>TBH I feel it will be easier to work in a separate clone^^</p>



<a name="168158146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158146">(Jun 14 2019 at 18:09)</a>:</h4>
<p>submodules are annoying as hell to deal with</p>



<a name="168158258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168158258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168158258">(Jun 14 2019 at 18:10)</a>:</h4>
<p>yeah I'll try to follow the instructions then</p>



<a name="168159076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159076">(Jun 14 2019 at 18:21)</a>:</h4>
<p>I tried to build miri with my locally built rustc and got an error:</p>



<a name="168159087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159087">(Jun 14 2019 at 18:21)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0107]: wrong number of lifetime arguments: expected 3, found 2
  --&gt; src/lib.rs:78:25
   |
78 | ) -&gt; InterpResult&lt;&#39;tcx, InterpretCx&lt;&#39;mir, &#39;tcx, Evaluator&lt;&#39;tcx&gt;&gt;&gt; {
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 lifetime arguments
</pre></div>



<a name="168159101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159101">(Jun 14 2019 at 18:21)</a>:</h4>
<p>well... a bunch of them tbh</p>



<a name="168159173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159173">(Jun 14 2019 at 18:22)</a>:</h4>
<p>maybe should I wait for my rustc changes to get merged and then try to build it</p>



<a name="168159202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159202">(Jun 14 2019 at 18:22)</a>:</h4>
<p>what does <code>rustc --version</code> say?</p>



<a name="168159207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159207">(Jun 14 2019 at 18:22)</a>:</h4>
<p>doesnt look like you are actually using latest master</p>



<a name="168159223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159223">(Jun 14 2019 at 18:23)</a>:</h4>
<p><code>rustc 1.37.0-dev</code></p>



<a name="168159229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159229">(Jun 14 2019 at 18:23)</a>:</h4>
<p>which commit</p>



<a name="168159248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159248">(Jun 14 2019 at 18:23)</a>:</h4>
<p>please dont cut off the most important part of the version number :)</p>



<a name="168159264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159264">(Jun 14 2019 at 18:23)</a>:</h4>
<p>there is no other part</p>



<a name="168159275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159275">(Jun 14 2019 at 18:23)</a>:</h4>
<p>oh dang it doesnt show that</p>



<a name="168159282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159282">(Jun 14 2019 at 18:23)</a>:</h4>
<p>I thought it would, sorry</p>



<a name="168159331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159331">(Jun 14 2019 at 18:24)</a>:</h4>
<p>so which commit did you build then?</p>



<a name="168159366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159366">(Jun 14 2019 at 18:24)</a>:</h4>
<p>on the last commit in my forked rustc</p>



<a name="168159412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159412">(Jun 14 2019 at 18:25)</a>:</h4>
<p>well then I can only guess^^</p>



<a name="168159471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159471">(Jun 14 2019 at 18:25)</a>:</h4>
<p>try <code>git reset --hard 118274f300d60d8a450cdbc16a72101efde23b12</code> in your miri clone</p>



<a name="168159482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159482">(Jun 14 2019 at 18:25)</a>:</h4>
<p>no the horror</p>



<a name="168159561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159561">(Jun 14 2019 at 18:26)</a>:</h4>
<p>well welcome to the world of closely interlinked projects with unstable APIs ;)</p>



<a name="168159606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159606">(Jun 14 2019 at 18:26)</a>:</h4>
<p>but TBH I am wodnering why your PR didnt need rebasing for this...?</p>



<a name="168159626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159626">(Jun 14 2019 at 18:27)</a>:</h4>
<p>I'm not sure to be honest</p>



<a name="168159647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159647">(Jun 14 2019 at 18:27)</a>:</h4>
<p>well can you please at least tell me the exact git commit on which you are building rustc?^^</p>



<a name="168159655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159655">(Jun 14 2019 at 18:27)</a>:</h4>
<p>maybe it was because I synced my fork with master after my last fiasco</p>



<a name="168159665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159665">(Jun 14 2019 at 18:27)</a>:</h4>
<p>I am not clairvoyant^^</p>



<a name="168159683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159683">(Jun 14 2019 at 18:27)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/commit/212f233b7d548c54ddec73142dfce1ee96a0c5c9" target="_blank" title="https://github.com/rust-lang/rust/commit/212f233b7d548c54ddec73142dfce1ee96a0c5c9">212f233b7d548c54ddec73142dfce1ee96a0c5c9</a></p>



<a name="168159759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159759">(Jun 14 2019 at 18:28)</a>:</h4>
<p>okay so its your PR. interesting that that did not need a rebase.</p>



<a name="168159785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159785">(Jun 14 2019 at 18:28)</a>:</h4>
<p>the issue is if you start working with that old miri you are going to get more conflicts</p>



<a name="168159833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159833">(Jun 14 2019 at 18:29)</a>:</h4>
<p>yeah I haven't done anything yet, I wanted to be sure that the build was successful</p>



<a name="168159838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159838">(Jun 14 2019 at 18:29)</a>:</h4>
<p>so you can either rebase your branch now (you dont have to push that, just do it locally), and then rebuild rustc; or you can move to an older miri like I suggested above but then you'll need more rebasing when you update your miri</p>



<a name="168159975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168159975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168159975">(Jun 14 2019 at 18:30)</a>:</h4>
<p>I think I'm going to wait a little bit, right now I'm on my work machine and it is slow as hell, when I get home I'll try to rebase my branch or something</p>



<a name="168239892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168239892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168239892">(Jun 16 2019 at 06:54)</a>:</h4>
<p>We'll have to step back a bit. For some reason the PR is not passing the tests when being rolled up. I rebased on local and runned the tests</p>



<a name="168239900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168239900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168239900">(Jun 16 2019 at 06:54)</a>:</h4>
<p>got the following error </p>
<div class="codehilite"><pre><span></span>---- [run-make] run-make-fulldeps/linker-output-non-utf8 stdout ----

error: make failed
status: exit code: 2
command: &quot;make&quot;
stdout:
------------------------------------------
LD_LIBRARY_PATH=&quot;/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage0/lib&quot; &#39;/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc&#39; --out-dir /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8 -L /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8  library.rs
mkdir /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8/zzz$&#39;\xff&#39;
mv /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8/liblibrary.a /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8/zzz$&#39;\xff&#39;
LD_LIBRARY_PATH=&quot;/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage0/lib&quot; &#39;/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc&#39; --out-dir /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8 -L /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8  -L /home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8/zzz$&#39;\xff&#39; exec.rs 2&gt;&amp;1 | &quot;/home/christian/Workspace/contrib/rust/src/etc/cat-and-grep.sh&quot; this_symbol_not_defined
[[[ begin stdout ]]]
error: Argument 6 is not valid Unicode: &quot;/home/christian/Workspace/contrib/rust/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/linker-output-non-utf8/linker-output-non-utf8/zzz\xFF&quot;


[[[ end stdout ]]]
Error: cannot match: this_symbol_not_defined
</pre></div>



<a name="168239981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168239981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168239981">(Jun 16 2019 at 06:56)</a>:</h4>
<p>I'm not sure how my changes are affecting this</p>



<a name="168241921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241921">(Jun 16 2019 at 08:00)</a>:</h4>
<p>that looks spurious or like a platform-dependent thing</p>



<a name="168241924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241924">(Jun 16 2019 at 08:00)</a>:</h4>
<p>TBH I never run the fulldepds tests^^</p>



<a name="168241936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241936">(Jun 16 2019 at 08:01)</a>:</h4>
<p>if I want to be really thorough I do <code>./x.py test --stage 1 src/test/{run-pass,ui}</code></p>



<a name="168241978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241978">(Jun 16 2019 at 08:02)</a>:</h4>
<p>but also, CI in your branch passed</p>



<a name="168241981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241981">(Jun 16 2019 at 08:02)</a>:</h4>
<p>so why do you think it is your PR causing the failure in the tollrup?</p>



<a name="168241987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168241987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168241987">(Jun 16 2019 at 08:02)</a>:</h4>
<p>one thing you could do is rebase and push that, to make sure CI in your branch actually runs against latest master</p>



<a name="168242004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242004">(Jun 16 2019 at 08:03)</a>:</h4>
<p>ah, I see... yeah <a href="https://github.com/rust-lang/rust/pull/61880#issuecomment-502417943" target="_blank" title="https://github.com/rust-lang/rust/pull/61880#issuecomment-502417943">https://github.com/rust-lang/rust/pull/61880#issuecomment-502417943</a> looks a lot like it might be your fault. but that's in Miri's test suite.</p>



<a name="168242009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242009">(Jun 16 2019 at 08:03)</a>:</h4>
<p>so what you could do is first rebase to get a working Miri again (that finally landed :D ), and then <code>./x.py test src/tools/miri</code></p>



<a name="168242049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242049">(Jun 16 2019 at 08:04)</a>:</h4>
<p>I rebased but I havent pushed it</p>



<a name="168242069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242069">(Jun 16 2019 at 08:04)</a>:</h4>
<p>going to run miri tests then</p>



<a name="168242149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242149">(Jun 16 2019 at 08:05)</a>:</h4>
<p>make sure you rebase to something that includes <a href="https://github.com/rust-lang/rust/pull/61832" target="_blank" title="https://github.com/rust-lang/rust/pull/61832">https://github.com/rust-lang/rust/pull/61832</a></p>



<a name="168242153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242153">(Jun 16 2019 at 08:05)</a>:</h4>
<p>which landed just 30min ago</p>



<a name="168242204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242204">(Jun 16 2019 at 08:06)</a>:</h4>
<p>yep I rebased like 5 mins ago</p>



<a name="168242281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242281">(Jun 16 2019 at 08:08)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> I think I found the bug: <a href="https://github.com/rust-lang/rust/pull/61781/files#r294072800" target="_blank" title="https://github.com/rust-lang/rust/pull/61781/files#r294072800">https://github.com/rust-lang/rust/pull/61781/files#r294072800</a></p>



<a name="168242354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242354">(Jun 16 2019 at 08:10)</a>:</h4>
<p>yay</p>



<a name="168242485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168242485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168242485">(Jun 16 2019 at 08:14)</a>:</h4>
<p>I did the change but I'll run tests before pushing</p>



<a name="168243520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168243520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168243520">(Jun 16 2019 at 08:44)</a>:</h4>
<p>I pushed my changes, got some trouble with the compilation pipeline but I think they'll be fine</p>



<a name="168243797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168243797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168243797">(Jun 16 2019 at 08:53)</a>:</h4>
<p>So did <code>./x.py test src/tools/miri</code> pass?</p>



<a name="168243848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168243848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168243848">(Jun 16 2019 at 08:54)</a>:</h4>
<p>nope, apparently my <code>rustc_llvm</code> version is too old so I'll have to recompile to be able to build it</p>
<p>Edit: I'm building it on local but it will take a while</p>



<a name="168243853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168243853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168243853">(Jun 16 2019 at 08:54)</a>:</h4>
<p>should I always test miri in this kind of changes?</p>



<a name="168244429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244429">(Jun 16 2019 at 09:13)</a>:</h4>
<p>well if you dont you might break miri which would make me sad ;)</p>



<a name="168244431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244431">(Jun 16 2019 at 09:13)</a>:</h4>
<p>Oh well, sure you can handle it</p>



<a name="168244432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244432">(Jun 16 2019 at 09:13)</a>:</h4>
<p>:P</p>



<a name="168244434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244434">(Jun 16 2019 at 09:13)</a>:</h4>
<p>;)</p>



<a name="168244474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244474">(Jun 16 2019 at 09:14)</a>:</h4>
<p>I usually test them with my separate miri clone, but that does not make much of a difference</p>



<a name="168244478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244478">(Jun 16 2019 at 09:14)</a>:</h4>
<p>you <em>do</em> have <code>test-miri = true</code> set in your <code>config.toml</code>, right?</p>



<a name="168244480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244480">(Jun 16 2019 at 09:14)</a>:</h4>
<p>ummm</p>



<a name="168244482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244482">(Jun 16 2019 at 09:14)</a>:</h4>
<p>well, given that this happened you already know the answer</p>



<a name="168244487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244487">(Jun 16 2019 at 09:15)</a>:</h4>
<p>ah no that doesnt mean miri gets automatically tested or something</p>



<a name="168244493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244493">(Jun 16 2019 at 09:15)</a>:</h4>
<p>that's just needed or else <code>test src/tools/miri</code> will fail</p>



<a name="168244499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244499">(Jun 16 2019 at 09:15)</a>:</h4>
<p>oh no I don't</p>



<a name="168244502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244502">(Jun 16 2019 at 09:15)</a>:</h4>
<p>I believe I have that on my other machine</p>



<a name="168244510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244510">(Jun 16 2019 at 09:15)</a>:</h4>
<p>but I'll change that here</p>



<a name="168244568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244568">(Jun 16 2019 at 09:17)</a>:</h4>
<p>Well LLVM is compiling but it will take a while</p>



<a name="168244705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244705">(Jun 16 2019 at 09:20)</a>:</h4>
<p>yeah those builds are sooooo slooooooooooo....</p>



<a name="168244731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244731">(Jun 16 2019 at 09:22)</a>:</h4>
<p>Well, I'll have breakfast and sleep a little, its like 4 am here</p>



<a name="168244794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168244794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168244794">(Jun 16 2019 at 09:23)</a>:</h4>
<blockquote>
<p>yeah those builds are sooooo slooooooooooo....</p>
</blockquote>
<p>I know, I'm thinking on saving money for a Ryzen just to compile rustc faster</p>



<a name="168246069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168246069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168246069">(Jun 16 2019 at 10:03)</a>:</h4>
<p>hmmm</p>



<a name="168246084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168246084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168246084">(Jun 16 2019 at 10:03)</a>:</h4>
<p>Got a different error on <code>rustc-llvm</code></p>
<div class="codehilite"><pre><span></span>error[E0523]: found two different crates with name `rustc_demangle` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.
</pre></div>



<a name="168246382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168246382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168246382">(Jun 16 2019 at 10:12)</a>:</h4>
<p>:(</p>



<a name="168246384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168246384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168246384">(Jun 16 2019 at 10:12)</a>:</h4>
<p>my best bet is to randomly delete files called <code>librustc_demangle*</code> in <code>build/</code></p>



<a name="168246401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168246401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168246401">(Jun 16 2019 at 10:13)</a>:</h4>
<p>or do <code>./x.py clean</code> (which will <em>not</em> delete your LLVM build) and then <code>./x.py test src/tools/miri</code> and then go to sleep ;)</p>



<a name="168253322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168253322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168253322">(Jun 16 2019 at 13:45)</a>:</h4>
<p>The thing is that I deleted the whole build directory for that build</p>



<a name="168257675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168257675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168257675">(Jun 16 2019 at 15:54)</a>:</h4>
<p>Ok I don't know why or how but the rebuild worked :P all tests passed</p>



<a name="168267497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168267497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168267497">(Jun 16 2019 at 20:56)</a>:</h4>
<p>nice!</p>



<a name="168320502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168320502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168320502">(Jun 17 2019 at 15:31)</a>:</h4>
<p>Im building rustc to start doing the miri changes</p>



<a name="168322492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168322492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168322492">(Jun 17 2019 at 15:54)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0107]: wrong number of lifetime arguments: expected 3, found 2
  --&gt; src/lib.rs:78:25
   |
78 | ) -&gt; InterpResult&lt;&#39;tcx, InterpretCx&lt;&#39;mir, &#39;tcx, Evaluator&lt;&#39;tcx&gt;&gt;&gt; {
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 lifetime arguments
</pre></div>


<p>After rebasing my rustc this keeps happening</p>



<a name="168326228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326228">(Jun 17 2019 at 16:38)</a>:</h4>
<p>what's your build invocation?</p>



<a name="168326256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326256">(Jun 17 2019 at 16:38)</a>:</h4>
<p>miri master works with rustc master as of right now</p>



<a name="168326269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326269">(Jun 17 2019 at 16:38)</a>:</h4>
<p>this looks like you are using a too-old-miri (again)</p>



<a name="168326295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326295">(Jun 17 2019 at 16:38)</a>:</h4>
<p>ah no. you are using a too-old-rustc.</p>



<a name="168326354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326354">(Jun 17 2019 at 16:39)</a>:</h4>
<p>cargo build</p>



<a name="168326423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326423">(Jun 17 2019 at 16:40)</a>:</h4>
<p>but it has the override to run my rustc</p>



<a name="168326579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326579">(Jun 17 2019 at 16:42)</a>:</h4>
<p>well it's not using a new enough one I'm afraid</p>



<a name="168326690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168326690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168326690">(Jun 17 2019 at 16:44)</a>:</h4>
<p>did you build all the way to stage 2?  is <code>rustc --version</code> plausible?</p>



<a name="168327527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168327527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168327527">(Jun 17 2019 at 16:56)</a>:</h4>
<p>yes i followed the miri README instructions</p>



<a name="168327607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168327607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168327607">(Jun 17 2019 at 16:57)</a>:</h4>
<p>well what can I say, the rustc you compiled/use is clearly not the one you think it should be, and without SSH access to your system I'm afraid I can't help you more than write instructions that, to the best of my knowledge, work when followed exactly.</p>



<a name="168327682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168327682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168327682">(Jun 17 2019 at 16:58)</a>:</h4>
<p>looks like you built a too-old-rustc then. or didn't rebuild after updating it. or you are using the wrong linked toolchain.</p>



<a name="168331656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168331656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168331656">(Jun 17 2019 at 17:49)</a>:</h4>
<p>I'm going to redo it and see what happens</p>



<a name="168337435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168337435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168337435">(Jun 17 2019 at 19:00)</a>:</h4>
<p>nope, still ran <code>./miri test</code> and it returned the same error</p>



<a name="168339980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168339980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168339980">(Jun 17 2019 at 19:26)</a>:</h4>
<p>I deleted my local branch and pulled from my fork to see what happens</p>



<a name="168340287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168340287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168340287">(Jun 17 2019 at 19:31)</a>:</h4>
<p>is <a href="https://github.com/rust-lang/rust/commit/1e388703c07c6f693d5974b9f8520403a4fc57c0" target="_blank" title="https://github.com/rust-lang/rust/commit/1e388703c07c6f693d5974b9f8520403a4fc57c0">1e388703c07c6f693d5974b9f8520403a4fc57c0</a> recent enough?</p>



<a name="168340977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168340977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168340977">(Jun 17 2019 at 19:41)</a>:</h4>
<p>does it include <a href="https://github.com/rust-lang/rust/commit/24ddd1615419be89828fb5628e3c14af86c08b01" target="_blank" title="https://github.com/rust-lang/rust/commit/24ddd1615419be89828fb5628e3c14af86c08b01">24ddd1615419be89828fb5628e3c14af86c08b01</a> ?</p>



<a name="168341010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168341010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168341010">(Jun 17 2019 at 19:41)</a>:</h4>
<p>and <a href="https://github.com/rust-lang/rust/commit/9606f6fa64926a84d82e3c62dbdc57f5c10f756d" target="_blank" title="https://github.com/rust-lang/rust/commit/9606f6fa64926a84d82e3c62dbdc57f5c10f756d">9606f6fa64926a84d82e3c62dbdc57f5c10f756d</a> ?</p>



<a name="168341279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168341279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168341279">(Jun 17 2019 at 19:45)</a>:</h4>
<p>well, <code>git show</code> shows both of them</p>



<a name="168342918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168342918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168342918">(Jun 17 2019 at 20:05)</a>:</h4>
<p>but I'm not sure which one happened before</p>



<a name="168343252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168343252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168343252">(Jun 17 2019 at 20:09)</a>:</h4>
<p>I rebased and I'm building again</p>



<a name="168346163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346163">(Jun 17 2019 at 20:49)</a>:</h4>
<p><code>git show $SHA</code> showing them just means that they are somewhere in your local clone, but does not say anything about them being in your branch</p>



<a name="168346220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346220">(Jun 17 2019 at 20:50)</a>:</h4>
<p><code>git log</code> without extra arguments would have to show them</p>



<a name="168346259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346259">(Jun 17 2019 at 20:50)</a>:</h4>
<p>(that's pager output, so you can search it by typing <code>/</code> and then what you are searching for)</p>



<a name="168346267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346267">(Jun 17 2019 at 20:50)</a>:</h4>
<p>i found the first but not the second</p>



<a name="168346340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346340">(Jun 17 2019 at 20:51)</a>:</h4>
<p>after rebasing both are there</p>



<a name="168346725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168346725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168346725">(Jun 17 2019 at 20:56)</a>:</h4>
<p>yay I'ts merged: <a href="https://github.com/rust-lang/rust/pull/61781" target="_blank" title="https://github.com/rust-lang/rust/pull/61781">https://github.com/rust-lang/rust/pull/61781</a></p>



<a name="168353003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168353003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168353003">(Jun 17 2019 at 22:24)</a>:</h4>
<p>ok after all of this I think I was able to make this work</p>



<a name="168353008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168353008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168353008">(Jun 17 2019 at 22:24)</a>:</h4>
<p>so... tests</p>



<a name="168358849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168358849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168358849">(Jun 18 2019 at 00:13)</a>:</h4>
<blockquote>
<p>one testcase should do something like <code>... as *const i32 as usize as u8 as usize</code> and make sure the value got truncated</p>
</blockquote>
<p>I did this in a test but its still failing when doing the <code>as u8</code> cast, is that ok?</p>



<a name="168362067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168362067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168362067">(Jun 18 2019 at 01:37)</a>:</h4>
<p>Given that there is no implementation inside mir for the new <code>Machine</code> methods i suppose the behaviour should be the same, right?</p>



<a name="168369477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168369477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168369477">(Jun 18 2019 at 04:45)</a>:</h4>
<p>mir -&gt; miri*</p>



<a name="168387226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168387226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168387226">(Jun 18 2019 at 10:21)</a>:</h4>
<p>yes, that is expected</p>



<a name="168396577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168396577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168396577">(Jun 18 2019 at 12:46)</a>:</h4>
<p>So what's the next step?</p>



<a name="168397044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397044">(Jun 18 2019 at 12:51)</a>:</h4>
<p>overwrite the <code>force*</code> methods on the machine and start experimenting with converting pointers to ints and back in the way I described on the issue</p>



<a name="168397060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397060">(Jun 18 2019 at 12:51)</a>:</h4>
<p>Though the conversion should be skipped if we don't have a random seed</p>



<a name="168397122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397122">(Jun 18 2019 at 12:52)</a>:</h4>
<p>without a random seed, we are in deterministic mode and should just bail out like we do right now</p>



<a name="168397484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397484">(Jun 18 2019 at 12:56)</a>:</h4>
<p>How does the miri project handle tests that should fail in deterministic mode only?</p>



<a name="168397614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397614">(Jun 18 2019 at 12:58)</a>:</h4>
<p>I think we have an example test using <code>rand</code></p>



<a name="168397621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397621">(Jun 18 2019 at 12:58)</a>:</h4>
<p>it should have a flag specified somewhere</p>



<a name="168397629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168397629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168397629">(Jun 18 2019 at 12:58)</a>:</h4>
<p>Ok I'll look it up</p>



<a name="168398035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168398035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168398035">(Jun 18 2019 at 13:03)</a>:</h4>
<p>if there are no tests, we should create some XD</p>



<a name="168399044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168399044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168399044">(Jun 18 2019 at 13:13)</a>:</h4>
<p>I'll check those in an hour, gotta get ready for work :P</p>



<a name="168399051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168399051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168399051">(Jun 18 2019 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> the new tests should have <code>// compile-flags: -Zmiri-seed=4242</code></p>



<a name="168399066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168399066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168399066">(Jun 18 2019 at 13:13)</a>:</h4>
<p>that will enable nondeterministic mode</p>



<a name="168399082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168399082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168399082">(Jun 18 2019 at 13:13)</a>:</h4>
<p>the existing tests dont have that flag and hence will still fail</p>



<a name="168403500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168403500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168403500">(Jun 18 2019 at 14:00)</a>:</h4>
<p>Heh, deterministic nondeterminism</p>



<a name="168403574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168403574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168403574">(Jun 18 2019 at 14:01)</a>:</h4>
<p>the best kind :)</p>



<a name="168403579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168403579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168403579">(Jun 18 2019 at 14:01)</a>:</h4>
<p>the best kind of nondeterminism</p>



<a name="168403583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168403583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168403583">(Jun 18 2019 at 14:01)</a>:</h4>
<p>lol</p>



<a name="168404693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168404693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168404693">(Jun 18 2019 at 14:13)</a>:</h4>
<p>Edward Lorenz kind of determinism.</p>



<a name="168418001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168418001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168418001">(Jun 18 2019 at 16:33)</a>:</h4>
<p>I'm doing <code>ptr_to_int</code></p>



<a name="168418139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168418139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168418139">(Jun 18 2019 at 16:35)</a>:</h4>
<p>when there is no entry in the hashmap for the ptr, what u64 should I use? in other words, what is <code>name_of_the_u64</code>  in <span class="user-mention" data-user-id="124288">@oli</span>  instructions?</p>



<a name="168418896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168418896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168418896">(Jun 18 2019 at 16:43)</a>:</h4>
<p>also in <code>memory.get(id).bytes.len()</code>,  do you mean <code>memory: Memory</code> or the hashmap? because <code>memory: Memory</code> is not accesible from  <code>ptr_to_int</code>, just <code>MemoryExtra</code>.</p>



<a name="168443360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168443360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168443360">(Jun 18 2019 at 18:43)</a>:</h4>
<blockquote>
<p>when there is no entry in the hashmap for the ptr, what u64 should I use? in other words, what is <code>name_of_the_u64</code>  in <span class="user-mention silent" data-user-id="124288">oli</span>  instructions?</p>
</blockquote>
<p>should It be the <code>u64</code> inside <code>AllocId</code>?</p>



<a name="168443661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168443661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168443661">(Jun 18 2019 at 18:46)</a>:</h4>
<p>just saw this and I have to say, <code>ptr_to_int</code> and <code>int_to_ptr</code> seem quite confusing :P</p>



<a name="168443902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168443902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168443902">(Jun 18 2019 at 18:49)</a>:</h4>
<p>but then again I'm not sure I have any better suggestions :(</p>



<a name="168443932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168443932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168443932">(Jun 18 2019 at 18:49)</a>:</h4>
<p>(but they seem ambiguous with language-level <code>usize</code> &lt;-&gt; <code>*mut T</code> casts)</p>



<a name="168444748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168444748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168444748">(Jun 18 2019 at 18:58)</a>:</h4>
<blockquote>
<p>just saw this and I have to say, <code>ptr_to_int</code> and <code>int_to_ptr</code> seem quite confusing :P</p>
</blockquote>
<p>I believe <span class="user-mention" data-user-id="120791">@RalfJ</span> has stronger naming opinions than me. I'm happy with whatever name you want to use :P</p>



<a name="168444783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168444783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168444783">(Jun 18 2019 at 18:58)</a>:</h4>
<blockquote>
<p>an operation called <code>int_to_ptr</code> IMO should have type int-to-ptr, or else something is off ;)</p>
</blockquote>
<p>This :P</p>



<a name="168447404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447404">(Jun 18 2019 at 19:30)</a>:</h4>
<p>well it has type <code>u128 -&gt; Pointer</code>, does it not?</p>



<a name="168447438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447438">(Jun 18 2019 at 19:30)</a>:</h4>
<p>oh you were quoting me?^^</p>



<a name="168447458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447458">(Jun 18 2019 at 19:30)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> well in some sense this is about the casts</p>



<a name="168447488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447488">(Jun 18 2019 at 19:31)</a>:</h4>
<p>right but "int" in the sense of "raw bits" not "surface language integer types"</p>



<a name="168447499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447499">(Jun 18 2019 at 19:31)</a>:</h4>
<p>similar with "ptr" - miri's <code>Pointer</code>, not merely a pointer type</p>



<a name="168447753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447753">(Jun 18 2019 at 19:34)</a>:</h4>
<p>if you want to discuss the implementation also I`ll be happy to join that discussion :P</p>



<a name="168447860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168447860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168447860">(Jun 18 2019 at 19:36)</a>:</h4>
<p>well the part about int/ptr values vs type is confusing everywhere. not sure what to do about it.</p>



<a name="168481055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481055">(Jun 19 2019 at 06:38)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> I think essentially we're going to need a <code>Vec&lt;(u64, AllocId)&gt;</code> for the int -&gt; ptr direction. What that <code>Vec</code> would contain would be the base addresses of the <code>AllocId</code> that went through a ptr -&gt; int transformation. You'll need to do a binary search on that for finding the <code>u64</code> in the <code>Vec</code> that is the largest one that is smaller or equal to the <code>u64</code> that you are searching for</p>



<a name="168481070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481070">(Jun 19 2019 at 06:39)</a>:</h4>
<p>the problem is that e.g. a user could do a ptr -&gt; int transformation for a pointer to the 5th element of an array</p>



<a name="168481075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481075">(Jun 19 2019 at 06:39)</a>:</h4>
<p>yeah I got that part</p>



<a name="168481081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481081">(Jun 19 2019 at 06:39)</a>:</h4>
<p>oh</p>



<a name="168481089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481089">(Jun 19 2019 at 06:39)</a>:</h4>
<p>you mean ptr to int</p>



<a name="168481090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481090">(Jun 19 2019 at 06:39)</a>:</h4>
<p>the real question is what <code>u64</code> should be</p>



<a name="168481091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481091">(Jun 19 2019 at 06:39)</a>:</h4>
<p>sorry</p>



<a name="168481153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481153">(Jun 19 2019 at 06:40)</a>:</h4>
<p>so as a start, create a <code>u64</code> field in the <code>ExtraData</code> of the <code>InterpCx</code> that denotes how many bytes have ever been part of an ptr -&gt; int transformation</p>



<a name="168481188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481188">(Jun 19 2019 at 06:41)</a>:</h4>
<p>so the first time anything is transformed, that value is 2^16 or sth (don't start with <code>0</code>) and thus the <code>u64</code> is 2^16. Then you add the <code>Allocation</code>'s byte size to the <code>ExtraData</code> field</p>



<a name="168481201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481201">(Jun 19 2019 at 06:41)</a>:</h4>
<blockquote>
<p>so as a start, create a <code>u64</code> field in the <code>ExtraData</code> of the <code>InterpCx</code> that denotes how many bytes have ever been part of an ptr -&gt; int transformation</p>
</blockquote>
<p>I think that should go in <code>MemoryExtra</code>, given that none of the methods can access <code>InterpCx</code> directrly</p>



<a name="168481202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481202">(Jun 19 2019 at 06:41)</a>:</h4>
<p>the next transformation will thus have its allocation directly next to it</p>



<a name="168481206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481206">(Jun 19 2019 at 06:42)</a>:</h4>
<p>right</p>



<a name="168481252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481252">(Jun 19 2019 at 06:42)</a>:</h4>
<p><code>MemoryExtra</code> is the right thing</p>



<a name="168481257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481257">(Jun 19 2019 at 06:42)</a>:</h4>
<p>ohhh now I get it</p>



<a name="168481271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481271">(Jun 19 2019 at 06:42)</a>:</h4>
<p>so this <code>u64</code> just keeps growing simulating the effect of allocating more and more stuff in memory</p>



<a name="168481285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481285">(Jun 19 2019 at 06:43)</a>:</h4>
<p>jop</p>



<a name="168481292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481292">(Jun 19 2019 at 06:43)</a>:</h4>
<p>in the future we can handle deallocations, but for now, let's do the easy thing</p>



<a name="168481294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481294">(Jun 19 2019 at 06:43)</a>:</h4>
<p>maybe this is a little too far, but what should happen when the <code>u64</code> overflows?</p>



<a name="168481347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481347">(Jun 19 2019 at 06:44)</a>:</h4>
<p>use <code>checked_add</code> and report an <code>Unimplemented</code> error xD</p>



<a name="168481355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481355">(Jun 19 2019 at 06:44)</a>:</h4>
<p>hahaha</p>



<a name="168481368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481368">(Jun 19 2019 at 06:45)</a>:</h4>
<p>well I believe that's enough to get me started tomorrow (now + 8h)</p>



<a name="168481378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481378">(Jun 19 2019 at 06:45)</a>:</h4>
<p>cool!</p>



<a name="168481385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481385">(Jun 19 2019 at 06:45)</a>:</h4>
<p>see you at 17:00 then :P</p>



<a name="168481393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168481393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168481393">(Jun 19 2019 at 06:45)</a>:</h4>
<p>jup :D</p>



<a name="168493410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168493410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168493410">(Jun 19 2019 at 10:06)</a>:</h4>
<blockquote>
<p>so the first time anything is transformed, that value is 2^16 or sth (don't start with <code>0</code>) and thus the <code>u64</code> is 2^16. Then you add the <code>Allocation</code>'s byte size to the <code>ExtraData</code> field</p>
</blockquote>
<p>I don't get the point of this?</p>



<a name="168493438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168493438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168493438">(Jun 19 2019 at 10:07)</a>:</h4>
<p>is this for picking a base address? those should be non-deterministic, that's why this depends on the seed</p>



<a name="168493447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168493447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168493447">(Jun 19 2019 at 10:07)</a>:</h4>
<p>so IMO you should ask the RNG for a random base address until you find one that works</p>



<a name="168493454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168493454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168493454">(Jun 19 2019 at 10:07)</a>:</h4>
<p>and give up after 100 attempts or so^^</p>



<a name="168493521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168493521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168493521">(Jun 19 2019 at 10:08)</a>:</h4>
<p>if we pick a fixed base address like 2^16, we might as well do this in all executions as everything is deterministic^^</p>



<a name="168495991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168495991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168495991">(Jun 19 2019 at 10:59)</a>:</h4>
<p>we can improve this algorithm at any time, I just chose the simplest one to start with</p>



<a name="168496081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168496081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168496081">(Jun 19 2019 at 11:00)</a>:</h4>
<p>We need to do something like you suggested anyway in order to be able to handle deallocations</p>



<a name="168496096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168496096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168496096">(Jun 19 2019 at 11:00)</a>:</h4>
<p>but for now we can skip any complex logic and just count up deterministically</p>



<a name="168497239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168497239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168497239">(Jun 19 2019 at 11:20)</a>:</h4>
<p>seems funny that we make a deterministic part of the execution depend on the "nondeterminism" flag, but whatever ;)</p>



<a name="168497242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168497242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168497242">(Jun 19 2019 at 11:20)</a>:</h4>
<p>fine for me</p>



<a name="168498140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168498140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168498140">(Jun 19 2019 at 11:36)</a>:</h4>
<p>hmm</p>



<a name="168498149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168498149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168498149">(Jun 19 2019 at 11:36)</a>:</h4>
<p>like we could also choose a random default for the nondeterminism flag and thus be deterministic</p>



<a name="168498168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168498168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168498168">(Jun 19 2019 at 11:37)</a>:</h4>
<p>I thought that the nondeterminsm flag is for things that aren't deterministic on hardware</p>



<a name="168500605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168500605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168500605">(Jun 19 2019 at 12:17)</a>:</h4>
<p>miri has nothing to do with hardware :P</p>



<a name="168500612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168500612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168500612">(Jun 19 2019 at 12:17)</a>:</h4>
<p>the goal is to implement the MIR spec. there is no MIR spec but most of the time we can imagine what it would be. and for allocation it'd certainly be non-deterministic.</p>



<a name="168501996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168501996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168501996">(Jun 19 2019 at 12:37)</a>:</h4>
<p>exactly, and that's why I'd want it behind the flag even if the actual implementation isn't non-deterministic yet</p>



<a name="168502261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168502261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168502261">(Jun 19 2019 at 12:40)</a>:</h4>
<p>oh absolutely. my surprise it not about the flag but about the lack of actual non-determinism. ;)</p>



<a name="168502452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168502452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168502452">(Jun 19 2019 at 12:43)</a>:</h4>
<p>yea, I should have communicated better that this is the first step implementation. I just didn't want the PR to get bigger than it will already get</p>



<a name="168519718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168519718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168519718">(Jun 19 2019 at 15:58)</a>:</h4>
<p>I'll leave a comment stating the fact that we need to pick the starting address randomly in the future.</p>



<a name="168535698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168535698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168535698">(Jun 19 2019 at 18:57)</a>:</h4>
<p>I have an small issue, in order to shift the <code>u64</code>, I need to get the size of the allocation, however I'm not sure how to do it because inside <code>int_to_ptr</code> and <code>ptr_to_int</code> I have no access to <code>Memory</code> itself, just to <code>MemoryExtra</code></p>



<a name="168541258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168541258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168541258">(Jun 19 2019 at 20:08)</a>:</h4>
<blockquote>
<p>I have an small issue, in order to shift the <code>u64</code>, I need to get the size of the allocation, however I'm not sure how to do it because inside <code>int_to_ptr</code> and <code>ptr_to_int</code> I have no access to <code>Memory</code> itself, just to <code>MemoryExtra</code></p>
</blockquote>
<p>Should I change the machine trait to take <code>Memory</code> or perhaps <code>InterpCx</code> instead of <code>MemoryExtra</code>?</p>



<a name="168544100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168544100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168544100">(Jun 19 2019 at 20:45)</a>:</h4>
<p><code>InterpCx</code> won't be possible because you need to call this in <code>Memory</code> methods... but you can change it to <code>Memory</code></p>



<a name="168544115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168544115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168544115">(Jun 19 2019 at 20:45)</a>:</h4>
<p>then please also change the other machine hooks that take <code>MemoryExtra</code>, for consisteny</p>



<a name="168546451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546451">(Jun 19 2019 at 21:12)</a>:</h4>
<blockquote>
<p><code>InterpCx</code> won't be possible because you need to call this in <code>Memory</code> methods... but you can change it to <code>Memory</code></p>
</blockquote>
<p>oh of course, i forget about the <code>Memory</code> ones. I'm going to do the changes in my local <code>rustc</code> to see if my <code>miri</code> changes work. I assume I should wrap the new <code>MemoryExtra</code> in miri like the <code>stacked_borrows</code>:  <code>Rc&lt;RefCell&lt;_&gt;&gt;</code></p>



<a name="168546551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546551">(Jun 19 2019 at 21:14)</a>:</h4>
<p>well see if you can pass <code>&amp;mut Memory</code> to <code>int_to_ptr</code>/<code>ptr_to_int</code></p>



<a name="168546559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546559">(Jun 19 2019 at 21:14)</a>:</h4>
<p>if yes you need no interior mutability</p>



<a name="168546570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546570">(Jun 19 2019 at 21:14)</a>:</h4>
<p>I need that for Stacked Borrows because some of the relevant machine hooks can only get <code>&amp;Memory</code>/<code>&amp;MemoryExtra</code></p>



<a name="168546591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546591">(Jun 19 2019 at 21:14)</a>:</h4>
<p>but the thing is that would force the usages of  <code>force_*</code> to have a mutable pointer of <code>Memory</code></p>



<a name="168546606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546606">(Jun 19 2019 at 21:15)</a>:</h4>
<p>yes</p>



<a name="168546619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546619">(Jun 19 2019 at 21:15)</a>:</h4>
<p>so if they dont have a mutable memory you cant do that</p>



<a name="168546624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546624">(Jun 19 2019 at 21:15)</a>:</h4>
<p>thats why I said see if you can do it :)</p>



<a name="168546695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546695">(Jun 19 2019 at 21:16)</a>:</h4>
<p>yeah I tried and saw that, but I think I'll go for the <code>Rc</code></p>



<a name="168546752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546752">(Jun 19 2019 at 21:17)</a>:</h4>
<p>you should need <code>Rc</code> even then</p>



<a name="168546754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546754">(Jun 19 2019 at 21:17)</a>:</h4>
<p>just <code>RefCell</code></p>



<a name="168546762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546762">(Jun 19 2019 at 21:17)</a>:</h4>
<p>I need <code>Rc</code> because I also need all allocations to share this pointer</p>



<a name="168546768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546768">(Jun 19 2019 at 21:17)</a>:</h4>
<p>but you wont need that</p>



<a name="168546781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168546781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168546781">(Jun 19 2019 at 21:17)</a>:</h4>
<p>Ohh ok</p>



<a name="168549238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168549238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168549238">(Jun 19 2019 at 21:57)</a>:</h4>
<p>I believe <code>ptr_to_int</code> is working, I'm going to do <code>int_to_ptr</code> now</p>



<a name="168550787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168550787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168550787">(Jun 19 2019 at 22:23)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="132916">Christian Poveda</span> I think essentially we're going to need a <code>Vec&lt;(u64, AllocId)&gt;</code> for the int -&gt; ptr direction. What that <code>Vec</code> would contain would be the base addresses of the <code>AllocId</code> that went through a ptr -&gt; int transformation. You'll need to do a binary search on that for finding the <code>u64</code> in the <code>Vec</code> that is the largest one that is smaller or equal to the <code>u64</code> that you are searching for</p>
</blockquote>
<p>So this means that the binary search would give me the "greater lower bound" for the one I'm searching for, right?. What should be the  <code>offset</code> for the pointer here? And what should happen when the greater lower bound is not equal to the <code>u64</code> I'm looking for? What should be the <code>AllocId</code> in this case?</p>



<a name="168572275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168572275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168572275">(Jun 20 2019 at 07:18)</a>:</h4>
<p>if you get the <code>int</code> 64 and find a "greatest lower bound" of 60, then you create a pointer with offset 4</p>



<a name="168572322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168572322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168572322">(Jun 20 2019 at 07:18)</a>:</h4>
<p>except you should make sure that this is still "inbounds" the allocation</p>



<a name="168591936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168591936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168591936">(Jun 20 2019 at 12:51)</a>:</h4>
<p>I suppose that means to check that the Int is smaller than the latest address used</p>



<a name="168594640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168594640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168594640">(Jun 20 2019 at 13:24)</a>:</h4>
<p>well once you got the base address you compute the offset</p>



<a name="168594653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168594653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168594653">(Jun 20 2019 at 13:25)</a>:</h4>
<p>and then you check <code>offset &lt;= alloc.size</code></p>



<a name="168594660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168594660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168594660">(Jun 20 2019 at 13:25)</a>:</h4>
<p>note the <code>=</code>! this is the "one-past-the-end" rule.</p>



<a name="168596535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168596535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168596535">(Jun 20 2019 at 13:45)</a>:</h4>
<p>At least in our current state of affairs</p>



<a name="168597704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168597704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168597704">(Jun 20 2019 at 13:57)</a>:</h4>
<p>no that should be the final state, this is how int-ptr-casts work</p>



<a name="168597727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168597727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168597727">(Jun 20 2019 at 13:57)</a>:</h4>
<p>which part of this <code>int_to_ptr</code> do you think is temporary?</p>



<a name="168598009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168598009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168598009">(Jun 20 2019 at 14:00)</a>:</h4>
<p>what do you mean?</p>



<a name="168598513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168598513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168598513">(Jun 20 2019 at 14:05)</a>:</h4>
<p>you said "At least in our current state of affairs". what did you refer to and what did you mean?</p>



<a name="168598951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168598951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168598951">(Jun 20 2019 at 14:10)</a>:</h4>
<blockquote>
<p>we can improve this algorithm at any time, I just chose the simplest one to start with</p>
</blockquote>
<p>Well I assume that simulating the memory allocations could eventually have a more sophisticated model</p>



<a name="168599182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168599182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168599182">(Jun 20 2019 at 14:13)</a>:</h4>
<blockquote>
<p>and then you check <code>offset &lt;= alloc.size</code></p>
</blockquote>
<p>So basically its a: "This thing fits here"</p>



<a name="168599354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168599354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168599354">(Jun 20 2019 at 14:15)</a>:</h4>
<blockquote>
<p>no that should be the final state, this is how int-ptr-casts work</p>
</blockquote>
<p>I shouldn't have skimmed the paper</p>



<a name="168599649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168599649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168599649">(Jun 20 2019 at 14:18)</a>:</h4>
<blockquote>
<p>Well I assume that simulating the memory allocations could eventually have a more sophisticated model</p>
</blockquote>
<p>I think the <code>u64-AllocId</code> mapping, plus a <code>base_address</code> field in <code>AllocationExtra</code> for the other direction, (do you have that yet?)  is a reasonable representation. and on the int-to-ptr side, there is not much choice, so whatever you are doing now (and what I described above) is the final version.</p>



<a name="168599668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168599668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168599668">(Jun 20 2019 at 14:18)</a>:</h4>
<p>the one place where we are choosing a preliminary option now is for how to allocate the offsets in ptr-to-int.</p>



<a name="168600168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600168">(Jun 20 2019 at 14:25)</a>:</h4>
<blockquote>
<p>I think the <code>u64-AllocId</code> mapping, plus a <code>base_address</code> field in <code>AllocationExtra</code> for the other direction, (do you have that yet?)  is a reasonable representation.</p>
</blockquote>
<p>Yes I wanted to do a single commit with both sides, I added the <code>base_address</code> as a field in <code>MemoryExtra</code>, should I move it to <code>AllocationExtra</code>?</p>



<a name="168600208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600208">(Jun 20 2019 at 14:25)</a>:</h4>
<blockquote>
<p>so whatever you are doing now (and what I described above) is the final version.</p>
</blockquote>
<p>Damn, there is no salvation from the <code>git blame</code>, this time</p>



<a name="168600322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600322">(Jun 20 2019 at 14:26)</a>:</h4>
<p>yea, git should totally mention the reviewer in <code>git blame</code>, too ;)</p>



<a name="168600351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600351">(Jun 20 2019 at 14:27)</a>:</h4>
<p>well you have a per-allocation base_address, so <code>AllocExtra</code> makes more sense IMO</p>



<a name="168600819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600819">(Jun 20 2019 at 14:32)</a>:</h4>
<p>just to be sure, the <code>base_address</code> is the integer that gets modified when doing <code>ptr_to_int</code>, i.e. Oliver's 2^16, right?</p>



<a name="168600916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600916">(Jun 20 2019 at 14:33)</a>:</h4>
<p>no</p>



<a name="168600936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600936">(Jun 20 2019 at 14:33)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> wants to move the ptr -&gt; int mapping into the <code>Allocation</code></p>



<a name="168600940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600940">(Jun 20 2019 at 14:33)</a>:</h4>
<p>which I support</p>



<a name="168600984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168600984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168600984">(Jun 20 2019 at 14:34)</a>:</h4>
<p>so we have one <code>HashMap</code> less</p>



<a name="168601020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601020">(Jun 20 2019 at 14:34)</a>:</h4>
<p>Wow wow, wait</p>



<a name="168601022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601022">(Jun 20 2019 at 14:34)</a>:</h4>
<p>if you want to map <code>Pointer</code> -&gt; int, you fetch the int via <code>memory.get(ptr.alloc_id)?.base_address + ptr.offset</code></p>



<a name="168601061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601061">(Jun 20 2019 at 14:35)</a>:</h4>
<p>At least that's what I understood?</p>



<a name="168601252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601252">(Jun 20 2019 at 14:37)</a>:</h4>
<blockquote>
<p>if you want to map <code>Pointer</code> -&gt; int, you fetch the int via <code>memory.get(ptr.alloc_id)?.base_address + ptr.offset</code></p>
</blockquote>
<p>then wouldnt we need the <code>Vec</code> for the <code>int_to_ptr</code> only and forget the <code>HashMap</code>? Is that what you mean  by having one HashMap less?</p>



<a name="168601452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601452">(Jun 20 2019 at 14:39)</a>:</h4>
<p>yes</p>



<a name="168601584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601584">(Jun 20 2019 at 14:41)</a>:</h4>
<p>Well If <span class="user-mention" data-user-id="120791">@RalfJ</span> agrees I'll do the change to <code>ptr_to_int</code> after fixing <code>int_to_ptr</code></p>



<a name="168601705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601705">(Jun 20 2019 at 14:42)</a>:</h4>
<p>yes  think we'll end up with a (sorted!) <code>Vec</code>, and an entry in <code>AllocExtra</code>, and no <code>HashMap</code></p>



<a name="168601758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168601758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168601758">(Jun 20 2019 at 14:43)</a>:</h4>
<p>the <code>Vec</code> is only queried in int-to-ptr, but of course ptr-to-int has to fill the <code>Vec</code> with the right information to make it match the base address stored in <code>AllocExtra</code></p>



<a name="168602186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602186">(Jun 20 2019 at 14:48)</a>:</h4>
<p>yep, understood. I'll come back in a few minutes with a bunch of errors</p>



<a name="168602630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602630">(Jun 20 2019 at 14:52)</a>:</h4>
<p>Taking a few steps back</p>
<blockquote>
<p>if you get the <code>int</code> 64 and find a "greatest lower bound" of 60, then you create a pointer with offset 4</p>
</blockquote>
<p>If we had a perfect match the offset would be zero following this idea. am I correctly assuming that this is the case when we have ZSTs?</p>



<a name="168602761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602761">(Jun 20 2019 at 14:54)</a>:</h4>
<p>pointer offset is unrelated to the actual types that are pointed at</p>



<a name="168602782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602782">(Jun 20 2019 at 14:54)</a>:</h4>
<p>basically a perfect match means your pointer points into the beginning of an <code>Allocation</code></p>



<a name="168602810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602810">(Jun 20 2019 at 14:54)</a>:</h4>
<p>oh so the offset is just the offset from inside the pointed value</p>



<a name="168602830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602830">(Jun 20 2019 at 14:55)</a>:</h4>
<p>if you get <code>64</code> from <code>Pointer(AllocId(something), 4)</code>, then <code>Pointer(AllocId(something), 0)</code> gives you <code>60</code></p>



<a name="168602842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602842">(Jun 20 2019 at 14:55)</a>:</h4>
<p>yes</p>



<a name="168602888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602888">(Jun 20 2019 at 14:55)</a>:</h4>
<p>which would be zero for  most basic types, just contiguous stuff like arrays, structs, tuples and so on would actually require to offset to access them</p>



<a name="168602972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602972">(Jun 20 2019 at 14:56)</a>:</h4>
<p>yes, but you may have a pointer to a basic type, and that pointer may be into a field of a struct</p>



<a name="168602997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168602997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168602997">(Jun 20 2019 at 14:57)</a>:</h4>
<p>or the user may have allocated random bytes on the heap and placed the value somewhere in there</p>



<a name="168603011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603011">(Jun 20 2019 at 14:57)</a>:</h4>
<p>e.g. <code>Rc&lt;u32&gt;</code> would never give you a zero offset to the <code>u32</code></p>



<a name="168603019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603019">(Jun 20 2019 at 14:57)</a>:</h4>
<p>because of the leading reference count</p>



<a name="168603109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603109">(Jun 20 2019 at 14:58)</a>:</h4>
<p>I'm slowly understanding whats going on, thank you</p>



<a name="168603312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603312">(Jun 20 2019 at 15:00)</a>:</h4>
<p>it's a confusing system to get into. I remember the madness at the beginning. We even had special ZST allocations and some other tricks like that</p>



<a name="168603336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603336">(Jun 20 2019 at 15:00)</a>:</h4>
<p>heheh</p>



<a name="168603353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603353">(Jun 20 2019 at 15:00)</a>:</h4>
<p>but it's very consistent now, just not obvious from the start I guess</p>



<a name="168603635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603635">(Jun 20 2019 at 15:03)</a>:</h4>
<p>ok now I'm in the part where there is no perfect match after doing a binary search. Checking the docs, I have the position (lets call it <code>pos</code>) where the integer would be inserted into the <code>Vec</code> to keep it sorted. If i understand correctly,  <code>vec[pos - 1]</code> would be our greatest lower bound, but what should happen when the <code>Vec</code> is empty? Should this be an error given that we are trying to transform an integer to a pointer that doesn't even exists?</p>



<a name="168603747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168603747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168603747">(Jun 20 2019 at 15:04)</a>:</h4>
<p>yea, that sounds reasonable</p>



<a name="168604016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604016">(Jun 20 2019 at 15:07)</a>:</h4>
<p>alternatively we could make the <code>Vec</code> never empty</p>



<a name="168604051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604051">(Jun 20 2019 at 15:07)</a>:</h4>
<p>if we fill it initially with <code>2^16</code> we'd fall back to that</p>



<a name="168604059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604059">(Jun 20 2019 at 15:07)</a>:</h4>
<p>but, hm, we'd have to map it to an <code>AllocId</code>...</p>



<a name="168604077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604077">(Jun 20 2019 at 15:08)</a>:</h4>
<p>also you'll have to handle <code>pos == 0</code> anyway</p>



<a name="168604762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604762">(Jun 20 2019 at 15:15)</a>:</h4>
<p>what about the tag? I assume these pointers should be untagged given that we are doing crazy raw pointer shenaningans anyway</p>



<a name="168604904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604904">(Jun 20 2019 at 15:17)</a>:</h4>
<p>yes. in fact int-to-ptr-tags is <em>exactly</em> what <code>Untagged</code> exists for :)</p>



<a name="168604930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604930">(Jun 20 2019 at 15:17)</a>:</h4>
<p>Man, two hits in a row, I'm on fire this morning</p>



<a name="168604944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604944">(Jun 20 2019 at 15:17)</a>:</h4>
<p><span aria-label="fire" class="emoji emoji-1f525" role="img" title="fire">:fire:</span></p>



<a name="168604952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168604952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168604952">(Jun 20 2019 at 15:17)</a>:</h4>
<p>or more like <span aria-label="fireworks" class="emoji emoji-1f386" role="img" title="fireworks">:fireworks:</span> ?</p>



<a name="168605365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168605365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168605365">(Jun 20 2019 at 15:22)</a>:</h4>
<p>we'll see, if travis doesn't get caught in the fire we'll decide</p>



<a name="168605476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168605476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168605476">(Jun 20 2019 at 15:23)</a>:</h4>
<p>ok time to fix the other way</p>



<a name="168606288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168606288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168606288">(Jun 20 2019 at 15:32)</a>:</h4>
<blockquote>
<p>and then you check <code>offset &lt;= alloc.size</code></p>
</blockquote>
<p>does this  <code>alloc</code> come from <code>Memory</code>?</p>



<a name="168606623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168606623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168606623">(Jun 20 2019 at 15:35)</a>:</h4>
<p>yeah that#s where we typically have our allocations :)</p>



<a name="168606681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168606681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168606681">(Jun 20 2019 at 15:36)</a>:</h4>
<p>3 in a row, this is going to fail in CI</p>



<a name="168606709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168606709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168606709">(Jun 20 2019 at 15:36)</a>:</h4>
<p>ok now it is time to ditch the HashMap</p>



<a name="168607291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168607291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168607291">(Jun 20 2019 at 15:43)</a>:</h4>
<blockquote>
<p>I think the u64-AllocId mapping, plus a base_address field in AllocationExtra for the other direction, (do you have that yet?) is a reasonable representation. and on the int-to-ptr side, there is not much choice, so whatever you are doing now (and what I described above) is the final version.</p>
</blockquote>
<p>So the <code>AllocationExtra</code> here is <code>stacked_borrows::Stacks</code>, should I put it there?</p>



<a name="168607605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168607605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168607605">(Jun 20 2019 at 15:47)</a>:</h4>
<p>or given that <code>Stacks</code> has the <code>GlobalState</code>, should I I put it there instead? <br>
Edit: This doesn't make sense, <code>GlobalState</code> is global after all</p>



<a name="168609141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168609141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168609141">(Jun 20 2019 at 16:04)</a>:</h4>
<p>Ok the fire is over.</p>



<a name="168609345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168609345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168609345">(Jun 20 2019 at 16:06)</a>:</h4>
<p>When does the <code>base_address</code> field acquires its value?</p>



<a name="168609978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168609978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168609978">(Jun 20 2019 at 16:15)</a>:</h4>
<blockquote>
<p>When does the <code>base_address</code> field acquires its value?</p>
</blockquote>
<p>Moreover, this means that not only the HashMap gets removed, the <code>u64</code> inside <code>MemoryExtra</code> (the one with the initial 2^16 value) should be removed too.</p>



<a name="168612538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168612538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168612538">(Jun 20 2019 at 16:46)</a>:</h4>
<p>Ohhhh I think I got it. So when <code>Stacks</code> is created, we get the <code>base_address</code> using the <code>u64</code> inside <code>MemoryExtra</code> with all the acrobatics of adding the size and stuff. Then inside <code>ptr_to_int</code> we just recover it</p>



<a name="168617620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168617620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168617620">(Jun 20 2019 at 17:48)</a>:</h4>
<blockquote>
<p>Ohhhh I think I got it. So when <code>Stacks</code> is created, we get the <code>base_address</code> using the <code>u64</code> inside <code>MemoryExtra</code> with all the acrobatics of adding the size and stuff. Then inside <code>ptr_to_int</code> we just recover it</p>
</blockquote>
<p>If this is right I believe I'm done with the implementation inside miri</p>



<a name="168617784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168617784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168617784">(Jun 20 2019 at 17:50)</a>:</h4>
<p>Probably is not because the <code>*std::ptr::null()</code>test is behaving unexpectedly<br>
Edit: Ok, the problem is that the tests are returning a different error, I can fix that later</p>



<a name="168618622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168618622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168618622">(Jun 20 2019 at 17:58)</a>:</h4>
<p>Ok none of the tests broke (after fixing the null ptr ones). So, now what about new tests?</p>



<a name="168619984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168619984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168619984">(Jun 20 2019 at 18:12)</a>:</h4>
<p>I believe there are some cases that I'm handling wrong because <code>&amp;42 as *const i32 as usize as u8 as usize;</code> still fails</p>



<a name="168633162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168633162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168633162">(Jun 20 2019 at 20:47)</a>:</h4>
<p>At least in our current state of affairs</p>



<a name="168661309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168661309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168661309">(Jun 21 2019 at 07:19)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> I'm not sure if you are still unsure about anything :D (except that tests are still failing)</p>



<a name="168661367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168661367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168661367">(Jun 21 2019 at 07:20)</a>:</h4>
<p>you can try <code>MIRI_BACKTRACE=1</code> to see where the error is reported from in the code</p>



<a name="168677217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168677217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168677217">(Jun 21 2019 at 12:34)</a>:</h4>
<p>At least in our current state of affairs</p>



<a name="168677244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168677244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168677244">(Jun 21 2019 at 12:35)</a>:</h4>
<p>Well I have to land the other PRs before submitting this one but I'll check it</p>



<a name="168677336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168677336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168677336">(Jun 21 2019 at 12:36)</a>:</h4>
<p>we landed a bunch of your stuff a few hours ago</p>



<a name="168678497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678497">(Jun 21 2019 at 12:53)</a>:</h4>
<p>I just saw it hehehe</p>



<a name="168678556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678556">(Jun 21 2019 at 12:54)</a>:</h4>
<p>Is everything OK with the python scripts?</p>



<a name="168678571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678571">(Jun 21 2019 at 12:54)</a>:</h4>
<p>just some issues not opening autmatically</p>



<a name="168678577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678577">(Jun 21 2019 at 12:54)</a>:</h4>
<p>I think I saw a PR where <span class="user-mention" data-user-id="120791">@RalfJ</span> was on it</p>



<a name="168678656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678656">(Jun 21 2019 at 12:55)</a>:</h4>
<p>well, kindof. I found the error message. but I still have no idea why it is failing.</p>



<a name="168678709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678709">(Jun 21 2019 at 12:56)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> you don't have to worry about this though, that's me screwing up an unrelated PR. ;)</p>



<a name="168678881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168678881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168678881">(Jun 21 2019 at 12:59)</a>:</h4>
<p>Mama, just lost a branch. Did git rebase against its head. I pressed enter, now it’s dead</p>



<a name="168679153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168679153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168679153">(Jun 21 2019 at 13:03)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> need any help recovering it?</p>



<a name="168680505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168680505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168680505">(Jun 21 2019 at 13:21)</a>:</h4>
<p>Nah no problems I was remembering the first "preparing for intptrcast" PR</p>



<a name="168680613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168680613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168680613">(Jun 21 2019 at 13:22)</a>:</h4>
<p>heh</p>



<a name="168680622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168680622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168680622">(Jun 21 2019 at 13:22)</a>:</h4>
<p>ususally you can recover everything</p>



<a name="168684487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168684487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168684487">(Jun 21 2019 at 14:07)</a>:</h4>
<p>if the rebase is still ongoing, do <code>git rebase --abort</code></p>



<a name="168684502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168684502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168684502">(Jun 21 2019 at 14:07)</a>:</h4>
<p>else <code>git reflog</code> should at least show every commit you ever created with <code>git commit</code>, and then you can use the SHA1 you get there to recover</p>



<a name="168684559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168684559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168684559">(Jun 21 2019 at 14:08)</a>:</h4>
<p><code>git rebase</code> is very easy to get wrong, I've been there several times as well :/</p>



<a name="168684738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168684738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168684738">(Jun 21 2019 at 14:11)</a>:</h4>
<p>the most common failure I've seen is to choose the wrong thing to rebase over XD So often it's that one rebases over the own fork's <code>master</code> instead of the upstream <code>master</code></p>



<a name="168685545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685545">(Jun 21 2019 at 14:22)</a>:</h4>
<p>my usual problem is that i squash the wrong commits D:</p>



<a name="168685635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685635">(Jun 21 2019 at 14:23)</a>:</h4>
<p>my usual problem is that I do <code>git commit --amend</code> when I should have done <code>git add . &amp;&amp; git rebase --continue</code></p>



<a name="168685713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685713">(Jun 21 2019 at 14:24)</a>:</h4>
<p>as in, I accidentally amend the previous commit after fixing conflicts during a rebase</p>



<a name="168685721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685721">(Jun 21 2019 at 14:24)</a>:</h4>
<p>Bad git practices: The const-eval definitive guide</p>



<a name="168685733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685733">(Jun 21 2019 at 14:24)</a>:</h4>
<p>I'm amazed how easily things can go wrong with git</p>



<a name="168685771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685771">(Jun 21 2019 at 14:25)</a>:</h4>
<p>it doesn't help that when doing rebase with some commtis marked to <code>edit</code>, you have to kind of remember if you are currently in "conflict resolution" or "editing" state, and hence have to use <code>git add . &amp;&amp; git rebase --coninue</code> or <code>git commit -a --amend</code> :/</p>



<a name="168685807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685807">(Jun 21 2019 at 14:25)</a>:</h4>
<p>I don't know, maybe one can change the $PS1 to reflect that state or something</p>



<a name="168685808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685808">(Jun 21 2019 at 14:25)</a>:</h4>
<p>I love the git data model. but much of its UI... ugh</p>



<a name="168685928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685928">(Jun 21 2019 at 14:27)</a>:</h4>
<p>hehehe</p>



<a name="168685937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685937">(Jun 21 2019 at 14:27)</a>:</h4>
<p>Well I'd like to discuss some errors with you</p>



<a name="168685973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168685973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168685973">(Jun 21 2019 at 14:27)</a>:</h4>
<p>do you remember that we are checking if <code>offset &lt;= alloc_size</code> during <code>int_to_ptr</code>?</p>



<a name="168686114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686114">(Jun 21 2019 at 14:29)</a>:</h4>
<p>What should be the appropriate error when the offset is larger than the size of the allocation?</p>



<a name="168686296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686296">(Jun 21 2019 at 14:31)</a>:</h4>
<p>that can't happen unless it's the last allocation</p>



<a name="168686387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686387">(Jun 21 2019 at 14:32)</a>:</h4>
<p>and in that case it doesn't matter, because you'll just have an invalid pointer into that allocation and thus will get an OOB error when you try to access it</p>



<a name="168686424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686424">(Jun 21 2019 at 14:32)</a>:</h4>
<p>oh</p>



<a name="168686470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686470">(Jun 21 2019 at 14:33)</a>:</h4>
<p>but that would be problematic if someone comes along later and creates a <code>ptr_to_int</code> that actually overlaps that region</p>



<a name="168686481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686481">(Jun 21 2019 at 14:33)</a>:</h4>
<p>so the pointer would suddenly be legal</p>



<a name="168686655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686655">(Jun 21 2019 at 14:35)</a>:</h4>
<p>I was thinking something like <code>PointerOutOfBounds</code> or <code>InvalidMemoryAccess</code></p>



<a name="168686773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686773">(Jun 21 2019 at 14:36)</a>:</h4>
<p>maybe just <code>Unimplemented</code> for now, I'm not sure about the expected semantics</p>



<a name="168686813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686813">(Jun 21 2019 at 14:37)</a>:</h4>
<p>sounds like a new error to me</p>



<a name="168686823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686823">(Jun 21 2019 at 14:37)</a>:</h4>
<p>invalid int-to-ptr-cast</p>



<a name="168686834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686834">(Jun 21 2019 at 14:37)</a>:</h4>
<p>the question is whether it should be an error?</p>



<a name="168686835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686835">(Jun 21 2019 at 14:37)</a>:</h4>
<p>for an address that was never returned by a ptr-to-int-cast</p>



<a name="168686839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686839">(Jun 21 2019 at 14:37)</a>:</h4>
<p>yes!</p>



<a name="168686842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686842">(Jun 21 2019 at 14:37)</a>:</h4>
<p>hm</p>



<a name="168686843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686843">(Jun 21 2019 at 14:37)</a>:</h4>
<p>ah :D</p>



<a name="168686851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686851">(Jun 21 2019 at 14:37)</a>:</h4>
<p>yes</p>



<a name="168686862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686862">(Jun 21 2019 at 14:37)</a>:</h4>
<p>ok, well then, new error it is</p>



<a name="168686863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686863">(Jun 21 2019 at 14:37)</a>:</h4>
<p>we only do <code>force_ptr</code> if we really need a ptr</p>



<a name="168686879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686879">(Jun 21 2019 at 14:37)</a>:</h4>
<p>so if we cant do the conversion, we have a dangling pointer</p>



<a name="168686880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686880">(Jun 21 2019 at 14:37)</a>:</h4>
<p>right</p>



<a name="168686896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168686896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168686896">(Jun 21 2019 at 14:38)</a>:</h4>
<p>and it should be errored as such</p>



<a name="168687089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687089">(Jun 21 2019 at 14:40)</a>:</h4>
<p>That would apply for every error in both methods?</p>



<a name="168687181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687181">(Jun 21 2019 at 14:41)</a>:</h4>
<p>because in <code>int_to_ptr</code> there is also the problem when the index returned by  the binary search is zero. Meaning that there is no address smaller than the current integer</p>



<a name="168687183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687183">(Jun 21 2019 at 14:41)</a>:</h4>
<p>what other errors do you have?</p>



<a name="168687200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687200">(Jun 21 2019 at 14:42)</a>:</h4>
<p>yes, that's the same error as being OOB of the last allocation</p>



<a name="168687330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687330">(Jun 21 2019 at 14:43)</a>:</h4>
<p>the last error is in <code>ptr_to_int</code> when adding the <code>alloc_id</code> to our <code>vec</code> if there is a <code>base_address</code> with the same <code>alloc_id</code> already stored</p>



<a name="168687411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687411">(Jun 21 2019 at 14:44)</a>:</h4>
<p>I believe that one is not an error, because it would happen everytime you call <code>ptr_to_int</code> with the same int I think</p>



<a name="168687443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687443">(Jun 21 2019 at 14:45)</a>:</h4>
<p>you should only do the allocation thing in <code>ptr_to_int</code> if there is no base address stored in the <code>AllocExtra</code> yet</p>



<a name="168687458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687458">(Jun 21 2019 at 14:45)</a>:</h4>
<p>otherwise just re-use what is already in the table(s)</p>



<a name="168687563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687563">(Jun 21 2019 at 14:46)</a>:</h4>
<blockquote>
<p>you should only do the allocation thing in <code>ptr_to_int</code> if there is no base address stored in the <code>AllocExtra</code> yet</p>
</blockquote>
<p>That could happen? I'm initializing the <code>AllocExtra</code> with a base address</p>



<a name="168687589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687589">(Jun 21 2019 at 14:47)</a>:</h4>
<p>hold on</p>



<a name="168687599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687599">(Jun 21 2019 at 14:47)</a>:</h4>
<p>o.o</p>



<a name="168687609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687609">(Jun 21 2019 at 14:47)</a>:</h4>
<p>can you push your PR :D I think we're diverging our mental models</p>



<a name="168687615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687615">(Jun 21 2019 at 14:47)</a>:</h4>
<p>not by much, but by a relevant point</p>



<a name="168687688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687688">(Jun 21 2019 at 14:48)</a>:</h4>
<p>we probably are, I'm going to let the errors as unimplemented and PR then</p>



<a name="168687694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168687694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168687694">(Jun 21 2019 at 14:48)</a>:</h4>
<p>I assumed there was an <code>Cell&lt;Option&lt;u64&gt;&gt;</code> in the <code>AllocExtra</code></p>



<a name="168688067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688067">(Jun 21 2019 at 14:53)</a>:</h4>
<p><a href="https://github.com/rust-lang/miri/pull/779" target="_blank" title="https://github.com/rust-lang/miri/pull/779">https://github.com/rust-lang/miri/pull/779</a></p>



<a name="168688260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688260">(Jun 21 2019 at 14:55)</a>:</h4>
<blockquote>
<p>I assumed there was an <code>Cell&lt;Option&lt;u64&gt;&gt;</code> in the <code>AllocExtra</code></p>
</blockquote>
<p>I thought about <code>Option&lt;u64&gt;</code> but then believed it was better to set the value during <code>Stacks::new</code></p>



<a name="168688541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688541">(Jun 21 2019 at 14:59)</a>:</h4>
<p>What should be the difference here?</p>



<a name="168688620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688620">(Jun 21 2019 at 15:00)</a>:</h4>
<p>it should not be done eagerly</p>



<a name="168688640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688640">(Jun 21 2019 at 15:00)</a>:</h4>
<p>you are doing it eagerly now</p>



<a name="168688667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688667">(Jun 21 2019 at 15:00)</a>:</h4>
<p>The idea was to do it in <code>ptr_to_int</code></p>



<a name="168688671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688671">(Jun 21 2019 at 15:00)</a>:</h4>
<p>Oh of course, I remember <span class="user-mention" data-user-id="120791">@RalfJ</span> 's insistence on the lazy part</p>



<a name="168688680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688680">(Jun 21 2019 at 15:00)</a>:</h4>
<p>going to fix it</p>



<a name="168688681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688681">(Jun 21 2019 at 15:00)</a>:</h4>
<p>hehe</p>



<a name="168688683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688683">(Jun 21 2019 at 15:00)</a>:</h4>
<p>wait a sec</p>



<a name="168688692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688692">(Jun 21 2019 at 15:00)</a>:</h4>
<p>you also kinda infected stacked borrows</p>



<a name="168688702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688702">(Jun 21 2019 at 15:01)</a>:</h4>
<p>I have to read the source for a sec</p>



<a name="168688708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688708">(Jun 21 2019 at 15:01)</a>:</h4>
<p>I haven't touched miri in too long</p>



<a name="168688725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688725">(Jun 21 2019 at 15:01)</a>:</h4>
<p>well I had to, but after removing the initalization of the base address that should be reverted</p>



<a name="168688827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688827">(Jun 21 2019 at 15:02)</a>:</h4>
<p>I think you should do what you did for the <code>MemoryState</code> and create a new struct that holds what you need and whatever stacked borrows need</p>



<a name="168688850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688850">(Jun 21 2019 at 15:02)</a>:</h4>
<p>what do you mean?</p>



<a name="168688872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688872">(Jun 21 2019 at 15:03)</a>:</h4>
<p>you can make <a href="https://github.com/rust-lang/miri/blob/285e9a65cd61520a4da1f912d1b41e523cd3a5e4/src/lib.rs#L390" target="_blank" title="https://github.com/rust-lang/miri/blob/285e9a65cd61520a4da1f912d1b41e523cd3a5e4/src/lib.rs#L390">https://github.com/rust-lang/miri/blob/285e9a65cd61520a4da1f912d1b41e523cd3a5e4/src/lib.rs#L390</a> point to other types</p>



<a name="168688882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688882">(Jun 21 2019 at 15:03)</a>:</h4>
<p>like adding an struct that contains <code>Stacks</code> and the <code>base_addr</code>?</p>



<a name="168688887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688887">(Jun 21 2019 at 15:03)</a>:</h4>
<p>yes</p>



<a name="168688895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168688895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168688895">(Jun 21 2019 at 15:03)</a>:</h4>
<p>Will do it then</p>



<a name="168689376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689376">(Jun 21 2019 at 15:09)</a>:</h4>
<p>Did you see the <code>Default</code> implementation inside <code>intptrcast.rs</code>?</p>



<a name="168689461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689461">(Jun 21 2019 at 15:10)</a>:</h4>
<p>I'm forcing the <code>u64</code> to be <code>2.pow(16)</code> there, should I also use <code>Option&lt;u64&gt;</code> and do that somewhere else?</p>



<a name="168689507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689507">(Jun 21 2019 at 15:11)</a>:</h4>
<p>no that's perfectly alright</p>



<a name="168689509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689509">(Jun 21 2019 at 15:11)</a>:</h4>
<p>that's the starting value</p>



<a name="168689515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689515">(Jun 21 2019 at 15:11)</a>:</h4>
<p>ok</p>



<a name="168689572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689572">(Jun 21 2019 at 15:12)</a>:</h4>
<p>the reason I wanted <code>Cell&lt;Option&lt;u64&gt;&gt;</code> inside <code>Allocation</code>s is that we can start with <code>None</code> and only fill it in in <code>ptr_to_int</code></p>



<a name="168689595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689595">(Jun 21 2019 at 15:12)</a>:</h4>
<p>so when you <code>ptr_to_int</code> an <code>Allocation</code> with <code>None</code> in its <code>base_address</code> field, you do the logic you did eagerly in <code>Stacks</code></p>



<a name="168689640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689640">(Jun 21 2019 at 15:13)</a>:</h4>
<p>Ja, but I was thinking about <span class="user-mention" data-user-id="120791">@RalfJ</span> 's comments about changing the starting value randomly</p>



<a name="168689655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689655">(Jun 21 2019 at 15:13)</a>:</h4>
<p>oh I remembered something else</p>



<a name="168689718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689718">(Jun 21 2019 at 15:14)</a>:</h4>
<p>how can I access the random seed from <code>Memory</code>? because <code>int_to_ptr</code> and <code>ptr_to_int</code> are not instance methods</p>



<a name="168689851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689851">(Jun 21 2019 at 15:16)</a>:</h4>
<p>oh, the starting value won't randomly change, it will be initialized with a random value once when <code>ptr_to_int</code> needs to set that value</p>



<a name="168689885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689885">(Jun 21 2019 at 15:16)</a>:</h4>
<p>oh, we may have to move the random seed to the <code>MemoryExtra</code> struct that already contains <code>Stacks</code> and <code>base_addr</code></p>



<a name="168689910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689910">(Jun 21 2019 at 15:17)</a>:</h4>
<p>(also maybe name <code>base_addr</code> as <code>next_base_addr</code> to reduce confusion with the <code>base_addr</code> field in <code>AllocExtra</code>)</p>



<a name="168689918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689918">(Jun 21 2019 at 15:17)</a>:</h4>
<p>maybe i should <code>derive</code> the <code>Default</code> and just set the <code>2.pow(16)</code> value inside the <code>intptrcast</code> methods when needed?<br>
Edit: nah forget it</p>



<a name="168689938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689938">(Jun 21 2019 at 15:17)</a>:</h4>
<p>no, the custom <code>Default</code> impl is a good idea</p>



<a name="168689999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168689999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168689999">(Jun 21 2019 at 15:18)</a>:</h4>
<p>well going to do all these small changes</p>



<a name="168690030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690030">(Jun 21 2019 at 15:18)</a>:</h4>
<p>yea sorry about not being really available the last few days</p>



<a name="168690039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690039">(Jun 21 2019 at 15:18)</a>:</h4>
<blockquote>
<p>oh, we may have to move the random seed to the <code>MemoryExtra</code> struct that already contains <code>Stacks</code> and <code>base_addr</code></p>
</blockquote>
<p>wait wait</p>



<a name="168690086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690086">(Jun 21 2019 at 15:19)</a>:</h4>
<p><code>Stacks</code> and <code>base_addr</code> would be in the new <code>AllocExtra</code> and those are allocation specific, do you mean <code>MemoryState</code> in <code>intptrcast.rs</code>?</p>



<a name="168690092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690092">(Jun 21 2019 at 15:19)</a>:</h4>
<p>oh</p>



<a name="168690094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690094">(Jun 21 2019 at 15:19)</a>:</h4>
<p>wait</p>



<a name="168690144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690144">(Jun 21 2019 at 15:20)</a>:</h4>
<p>sorry yes, <code>MemoryState</code></p>



<a name="168690170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690170">(Jun 21 2019 at 15:20)</a>:</h4>
<p>I'm happy to see that small details :D</p>



<a name="168690219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690219">(Jun 21 2019 at 15:21)</a>:</h4>
<p>yes, four eyes are great</p>



<a name="168690287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168690287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168690287">(Jun 21 2019 at 15:22)</a>:</h4>
<p>Well it means that I'm starting to understand some parts better</p>



<a name="168692193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168692193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168692193">(Jun 21 2019 at 15:46)</a>:</h4>
<p>I finished disinfencting <code>stacked_borrows.rs</code> :P</p>



<a name="168698594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168698594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168698594">(Jun 21 2019 at 17:09)</a>:</h4>
<blockquote>
<p>I finished disinfencting <code>stacked_borrows.rs</code> :P</p>
</blockquote>
<p>Thanks :D</p>



<a name="168699311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168699311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168699311">(Jun 21 2019 at 17:21)</a>:</h4>
<p>But now we have to move the AllocationExtra implementation outside <a href="http://stacked_borrows.rs" target="_blank" title="http://stacked_borrows.rs">stacked_borrows.rs</a></p>



<a name="168699574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168699574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168699574">(Jun 21 2019 at 17:25)</a>:</h4>
<p>yes, both <code>MemoryExtra</code> and <code>AllocationExtra</code> should be structs with two fields -- one from stacked_borrows and one from intptrcast.</p>



<a name="168699957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168699957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168699957">(Jun 21 2019 at 17:30)</a>:</h4>
<p>Yep will do that</p>



<a name="168707602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707602">(Jun 21 2019 at 19:06)</a>:</h4>
<p>Ok I did the changes</p>



<a name="168707643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707643">(Jun 21 2019 at 19:06)</a>:</h4>
<p>I'm not completely sold on the idea of using the Dangling Pointer error but  I changed the tests accordingly</p>



<a name="168707669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707669">(Jun 21 2019 at 19:07)</a>:</h4>
<p>what error would you have used?</p>



<a name="168707685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707685">(Jun 21 2019 at 19:07)</a>:</h4>
<p>and do you know what kind of code can trigger this error?</p>



<a name="168707729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707729">(Jun 21 2019 at 19:07)</a>:</h4>
<p>there are several cases</p>



<a name="168707801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707801">(Jun 21 2019 at 19:08)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span>: <span class="kt">i32</span> <span class="o">=</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="o">*</span><span class="n">std</span>::<span class="n">ptr</span>::<span class="n">null</span><span class="p">()</span><span class="w"> </span><span class="p">};</span><span class="w"> </span><span class="c1">//~ ERROR dangling pointer was dereferenced</span>
</pre></div>



<a name="168707811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707811">(Jun 21 2019 at 19:08)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">g</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">transmute</span>::<span class="o">&lt;</span><span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="k">fn</span><span class="p">(</span><span class="kt">i32</span><span class="p">)</span><span class="o">&gt;</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">};</span><span class="w"></span>

<span class="w">    </span><span class="n">g</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span><span class="w"> </span><span class="c1">//~ ERROR dangling pointer was dereferenced</span>
</pre></div>



<a name="168707861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707861">(Jun 21 2019 at 19:08)</a>:</h4>
<p>I mean probably for the first we could add an special case when the ptr is zero as in the default machine impl</p>



<a name="168707877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168707877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168707877">(Jun 21 2019 at 19:09)</a>:</h4>
<p>but the second one, i don't know, that is not even a proper dangling pointer, it was created by doing an "invalid" cast</p>



<a name="168708002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708002">(Jun 21 2019 at 19:10)</a>:</h4>
<p>But yeah those are rough edges at the end, we can fix that next week</p>



<a name="168708122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708122">(Jun 21 2019 at 19:12)</a>:</h4>
<p>I'm more interested in knowing why </p>
<div class="codehilite"><pre><span></span><span class="o">&amp;</span><span class="mi">42</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">usize</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">usize</span><span class="p">;</span><span class="w"></span>
</pre></div>


<p>fails</p>



<a name="168708150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708150">(Jun 21 2019 at 19:12)</a>:</h4>
<p>shouldn't that be accepted by <code>miri</code> now?</p>



<a name="168708526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708526">(Jun 21 2019 at 19:16)</a>:</h4>
<blockquote>
<p>but the second one, i don't know, that is not even a proper dangling pointer, it was created by doing an "invalid" cast</p>
</blockquote>
<p>"proper dangling pointer"? you mean it's too dangling to be put into one category with the other dangling pointers? <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="168708564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708564">(Jun 21 2019 at 19:17)</a>:</h4>
<p>a pointer is dangling if it doesnt point to valid memory. whether it was obtained by casting from a pad int, out-of-bounds arithmetic or use-after-free doesn't matter.</p>



<a name="168708579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708579">(Jun 21 2019 at 19:17)</a>:</h4>
<blockquote>
<p>shouldn't that be accepted by <code>miri</code> now?</p>
</blockquote>
<p>no, we specifically did not use <code>force_bits</code> for the casting stuff</p>



<a name="168708583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708583">(Jun 21 2019 at 19:17)</a>:</h4>
<p>because that code is messy</p>



<a name="168708714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708714">(Jun 21 2019 at 19:19)</a>:</h4>
<blockquote>
<p>"proper dangling pointer"? you mean it's too dangling to be put into one category with the other dangling pointers? <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>
</blockquote>
<p>Well meine Wenigkeit believes that dangling pointers are created when you free memory and leave pointers to that memory segment.</p>
<p>So when I saw the "dangling pointer" error it was more like: I'm actually creating a wild pointer than a dangling one</p>



<a name="168708756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708756">(Jun 21 2019 at 19:19)</a>:</h4>
<blockquote>
<blockquote>
<p>shouldn't that be accepted by <code>miri</code> now?</p>
</blockquote>
<p>no, we specifically did not use <code>force_bits</code> for the casting stuff</p>
</blockquote>
<p>Should we add anymore tests to check that the <code>force_*</code> methods are working as expected?</p>



<a name="168708894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708894">(Jun 21 2019 at 19:21)</a>:</h4>
<p>so something like <code>Box::into_raw(Box::new(0u32)).wrapping_offset(8)</code> is also not "dangling"?</p>



<a name="168708977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168708977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168708977">(Jun 21 2019 at 19:22)</a>:</h4>
<blockquote>
<p>Should we add anymore tests to check that the force_* methods are working as expected?</p>
</blockquote>
<p>well you added <code>force_bits</code> to slice indexing</p>



<a name="168709001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709001">(Jun 21 2019 at 19:22)</a>:</h4>
<p>so a weird thing you could so is to cast a ptr to an int and use that as a slice index</p>



<a name="168709010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709010">(Jun 21 2019 at 19:22)</a>:</h4>
<p>but uh there'll be a bounds check first</p>



<a name="168709041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709041">(Jun 21 2019 at 19:23)</a>:</h4>
<p>ah but you could make it a huge ZST slice :D</p>



<a name="168709098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709098">(Jun 21 2019 at 19:23)</a>:</h4>
<p>also you could add in miri some <code>force_bits</code> to <code>ptr_op</code>, then stuff like <code>(&amp;mut 4 as *mut _ as usize) * 2</code> should work</p>



<a name="168709144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709144">(Jun 21 2019 at 19:24)</a>:</h4>
<blockquote>
<p>so something like <code>Box::into_raw(Box::new(0u32)).wrapping_offset(8)</code> is also not "dangling"?</p>
</blockquote>
<p>Well I would say that it isn't, because it was not a valid pointer that didn't get invalidated after freeing memory, just an invalid pointer created from a valid one. But again I don't have any proper arguments to say that something is or it is not dangling</p>



<a name="168709186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709186">(Jun 21 2019 at 19:24)</a>:</h4>
<p>you are just using a different definition for the same term, it's okay</p>



<a name="168709191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709191">(Jun 21 2019 at 19:24)</a>:</h4>
<p>I can't say you are wrong</p>



<a name="168709201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709201">(Jun 21 2019 at 19:24)</a>:</h4>
<p>but in Miri we have used "dangling" to mean "pointer that cannot be dereferenced"</p>



<a name="168709204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709204">(Jun 21 2019 at 19:25)</a>:</h4>
<p>so 42 is certainly dangling</p>



<a name="168709210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709210">(Jun 21 2019 at 19:25)</a>:</h4>
<p>oh great</p>



<a name="168709213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709213">(Jun 21 2019 at 19:25)</a>:</h4>
<p>and null is dangling too i suppose</p>



<a name="168709220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709220">(Jun 21 2019 at 19:25)</a>:</h4>
<p>NULL always got a special error</p>



<a name="168709222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709222">(Jun 21 2019 at 19:25)</a>:</h4>
<p>don't ask me why^^</p>



<a name="168709237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709237">(Jun 21 2019 at 19:25)</a>:</h4>
<p>Should we keep that special error?</p>



<a name="168709242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709242">(Jun 21 2019 at 19:25)</a>:</h4>
<p>maybe keep that for now</p>



<a name="168709249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709249">(Jun 21 2019 at 19:25)</a>:</h4>
<p>I have an error refactoring on my todo list anyway</p>



<a name="168709256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709256">(Jun 21 2019 at 19:25)</a>:</h4>
<p>then it'll go :P</p>



<a name="168709306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709306">(Jun 21 2019 at 19:26)</a>:</h4>
<p>ok I'll change the method to return the NullPtr error instead when the int is zero</p>



<a name="168709365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709365">(Jun 21 2019 at 19:26)</a>:</h4>
<p>i'm still a little bit confused about what should be a good test here</p>



<a name="168709428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709428">(Jun 21 2019 at 19:27)</a>:</h4>
<p>I think we already have some dangling ptr tests, including casting a random integer to a ptr and using it</p>



<a name="168709506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709506">(Jun 21 2019 at 19:28)</a>:</h4>
<p>you could duplicate those to make sure they still error with <code>-Zmiri-seed=...</code> (i.e., with intrptrcast enabled)</p>



<a name="168709534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709534">(Jun 21 2019 at 19:28)</a>:</h4>
<p>oh I forgot about the seed, I have to fix that</p>



<a name="168709565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709565">(Jun 21 2019 at 19:29)</a>:</h4>
<p>:D</p>



<a name="168709579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709579">(Jun 21 2019 at 19:29)</a>:</h4>
<p>now I'm just letting intptrcast enabled by default hahaha</p>



<a name="168709587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709587">(Jun 21 2019 at 19:29)</a>:</h4>
<p>not sure if there is much to do in terms of compile-fail tests otherwise TBH</p>



<a name="168709666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709666">(Jun 21 2019 at 19:30)</a>:</h4>
<p>where are the non-determinist tests in miri?</p>



<a name="168709672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709672">(Jun 21 2019 at 19:30)</a>:</h4>
<p>well I think we might even want to do that at some point, both to kill some awful code and to avoid having to duplicate our entire test suite... but not yet</p>



<a name="168709681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709681">(Jun 21 2019 at 19:30)</a>:</h4>
<p>there aren't many^^</p>



<a name="168709684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709684">(Jun 21 2019 at 19:30)</a>:</h4>
<p>or how do you handle that?</p>



<a name="168709691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709691">(Jun 21 2019 at 19:30)</a>:</h4>
<p>handle?</p>



<a name="168709710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709710">(Jun 21 2019 at 19:31)</a>:</h4>
<p><code>// compile-flags: -Zmiri-seed=4242</code></p>



<a name="168709715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709715">(Jun 21 2019 at 19:31)</a>:</h4>
<p>ohhh ok</p>



<a name="168709724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709724">(Jun 21 2019 at 19:31)</a>:</h4>
<p>didn't I already tell you that? anyway^^</p>



<a name="168709741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168709741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168709741">(Jun 21 2019 at 19:31)</a>:</h4>
<p>maybe, I have the memory of a fly</p>



<a name="168710577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168710577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168710577">(Jun 21 2019 at 19:43)</a>:</h4>
<p>How can I make the <code>seed</code> to get all the way down to <code>MemoryExtra</code>?</p>



<a name="168710652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168710652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168710652">(Jun 21 2019 at 19:44)</a>:</h4>
<p>oh i know how :P</p>



<a name="168710653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168710653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168710653">(Jun 21 2019 at 19:44)</a>:</h4>
<p>nvm</p>



<a name="168711874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168711874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168711874">(Jun 21 2019 at 20:02)</a>:</h4>
<blockquote>
<p>I think we already have some dangling ptr tests, including casting a random integer to a ptr and using it<br>
you could duplicate those to make sure they still error with -Zmiri-seed=... (i.e., with intrptrcast enabled)</p>
</blockquote>
<p>what about:<br>
- <code>cast_int_to_fn_ptr.rs</code><br>
-  <code>dangling_pointer_deref.rs</code><br>
- <code>null_pointer_deref.rs</code><br>
are they good candidates?</p>



<a name="168713898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168713898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168713898">(Jun 21 2019 at 20:29)</a>:</h4>
<p>the fn ptr thing is weird, but sure^^ reminds me that we should have run-pass tests that roudntrip a fn ptr through an int</p>



<a name="168713988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168713988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168713988">(Jun 21 2019 at 20:30)</a>:</h4>
<p>Should I add other similar tests? like the null pointer write? or just those are fine?</p>



<a name="168713994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168713994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168713994">(Jun 21 2019 at 20:30)</a>:</h4>
<p>dangling_pointer_deref looks good, though you'll have to extend it such that <code>ptr_to_int</code> even gets called</p>



<a name="168714071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168714071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168714071">(Jun 21 2019 at 20:31)</a>:</h4>
<p><code>wild_pointer_deref.rs</code> was the one I originally thought of</p>



<a name="168714172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168714172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168714172">(Jun 21 2019 at 20:32)</a>:</h4>
<p>oh ok I'll do wild pointer then</p>



<a name="168714178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168714178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168714178">(Jun 21 2019 at 20:32)</a>:</h4>
<p>other than that, I think we are ready to go</p>



<a name="168715637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168715637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168715637">(Jun 21 2019 at 20:52)</a>:</h4>
<p>You can do the as usize test by using transmute instead</p>



<a name="168715723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168715723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168715723">(Jun 21 2019 at 20:52)</a>:</h4>
<p>That way you can even assert a specific int address for an address of a local</p>



<a name="168715733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168715733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168715733">(Jun 21 2019 at 20:52)</a>:</h4>
<p>this one <code>&amp;42 as *const i32 as usize as u8 as usize;</code>?</p>



<a name="168715837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168715837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168715837">(Jun 21 2019 at 20:54)</a>:</h4>
<p>or which one do you mean?</p>



<a name="168716577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716577">(Jun 21 2019 at 21:05)</a>:</h4>
<p>I guess the first cast to usize</p>



<a name="168716593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716593">(Jun 21 2019 at 21:05)</a>:</h4>
<p>I think that would require some more patches in <code>allocation.rs</code></p>



<a name="168716599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716599">(Jun 21 2019 at 21:05)</a>:</h4>
<p>Then maybe do *2 or sth yo trigger the transform</p>



<a name="168716605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716605">(Jun 21 2019 at 21:05)</a>:</h4>
<p>to allow reading parts of the bytes of an allocation</p>



<a name="168716648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716648">(Jun 21 2019 at 21:06)</a>:</h4>
<p>yeah <code>* 2</code> should work. but not transmute.</p>



<a name="168716690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716690">(Jun 21 2019 at 21:07)</a>:</h4>
<blockquote>
<p>yeah <code>* 2</code> should work. but not transmute.</p>
</blockquote>
<p>I'm confused, where is the <code>*2</code> supposed to go?</p>



<a name="168716881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716881">(Jun 21 2019 at 21:09)</a>:</h4>
<p><code>(&amp;32 as *const _ as usize) * 2</code></p>



<a name="168716886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716886">(Jun 21 2019 at 21:09)</a>:</h4>
<p>do you understand why that is needed?</p>



<a name="168716962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716962">(Jun 21 2019 at 21:10)</a>:</h4>
<p>not really</p>



<a name="168716967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716967">(Jun 21 2019 at 21:10)</a>:</h4>
<p>remember the thing about int/ptr <em>values</em> vs <em>types</em></p>



<a name="168716971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716971">(Jun 21 2019 at 21:10)</a>:</h4>
<p>yep</p>



<a name="168716979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716979">(Jun 21 2019 at 21:10)</a>:</h4>
<p><code>(&amp;32 as *const _ as usize)</code> is a pointer value at int type</p>



<a name="168716991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716991">(Jun 21 2019 at 21:11)</a>:</h4>
<p>the casting code doesn't to <code>ptr_to_int</code></p>



<a name="168716998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168716998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168716998">(Jun 21 2019 at 21:11)</a>:</h4>
<p>whether it should I am not sure</p>



<a name="168717021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717021">(Jun 21 2019 at 21:11)</a>:</h4>
<p>but even if it did, <code>mem::transmute::&lt;usize, _&gt;(&amp;32)</code> would certainly not call it</p>



<a name="168717067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717067">(Jun 21 2019 at 21:12)</a>:</h4>
<p>and thus we anyway have to be able to handle ptr values at int type</p>



<a name="168717089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717089">(Jun 21 2019 at 21:12)</a>:</h4>
<p>so by doing <code>* 2</code> we end up in the <code>bin_op</code> code in <code>operand.rs</code>, and because one argument has ptr value, we dispatch to <code>ptr_op</code> in the machine</p>



<a name="168717100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717100">(Jun 21 2019 at 21:12)</a>:</h4>
<p>and that's a good place for Miri to do <code>force_bits</code></p>



<a name="168717115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717115">(Jun 21 2019 at 21:12)</a>:</h4>
<p>ohhh</p>



<a name="168717122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717122">(Jun 21 2019 at 21:13)</a>:</h4>
<p>and <em>then</em> we finally run <code>ptr_to_int</code></p>



<a name="168717128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717128">(Jun 21 2019 at 21:13)</a>:</h4>
<p>ok I understand</p>



<a name="168717137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717137">(Jun 21 2019 at 21:13)</a>:</h4>
<p>buuuut even then</p>



<a name="168717175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717175">(Jun 21 2019 at 21:14)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="mi">42</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">usize</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
</pre></div>


<p>fails with: attempted to do invalid arithmetic on pointers that would leak base addresses,</p>



<a name="168717228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717228">(Jun 21 2019 at 21:14)</a>:</h4>
<p>probably because you didn't add the <code>force_bits</code> in Miri's implementation of <code>ptr_op</code>?</p>



<a name="168717243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717243">(Jun 21 2019 at 21:14)</a>:</h4>
<p>should I??</p>



<a name="168717251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717251">(Jun 21 2019 at 21:14)</a>:</h4>
<p>yes :)</p>



<a name="168717259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717259">(Jun 21 2019 at 21:14)</a>:</h4>
<p>oh ok thats a new one</p>



<a name="168717275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717275">(Jun 21 2019 at 21:15)</a>:</h4>
<p>basically right here: <a href="https://github.com/rust-lang/miri/blob/beba8c4d8a100824867c1ec36dbaa817056e5547/src/operator.rs#L45" target="_blank" title="https://github.com/rust-lang/miri/blob/beba8c4d8a100824867c1ec36dbaa817056e5547/src/operator.rs#L45">https://github.com/rust-lang/miri/blob/beba8c4d8a100824867c1ec36dbaa817056e5547/src/operator.rs#L45</a></p>



<a name="168717296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717296">(Jun 21 2019 at 21:15)</a>:</h4>
<p>we talked about this a while ago on he rustc side, and then agreed to do this on the miri side</p>



<a name="168717314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717314">(Jun 21 2019 at 21:15)</a>:</h4>
<p>ohhh yeah now I remember the conversation</p>



<a name="168717322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717322">(Jun 21 2019 at 21:15)</a>:</h4>
<p>what that code should do is, check if we run with intrptrcast, and if yes, <em>if the operator is not <code>Offset</code></em>, call <code>force_bits</code> on both operands and dispatch back to rustc</p>



<a name="168717422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717422">(Jun 21 2019 at 21:17)</a>:</h4>
<p>all operators except for <code>Offset</code> should be implemented by looking at the integer values.<br>
at least that's my position. this includes pointer comparisons so <span class="user-mention" data-user-id="124288">@oli</span> might disagree. ;)</p>



<a name="168717472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717472">(Jun 21 2019 at 21:17)</a>:</h4>
<p>it's certainly a reasonable start though, we can always tweak later</p>



<a name="168717554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717554">(Jun 21 2019 at 21:18)</a>:</h4>
<p>anyway it's getting late here, I'm out. good night!</p>



<a name="168717571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717571">(Jun 21 2019 at 21:18)</a>:</h4>
<p>Ok Ralf, thanks for the explanation</p>



<a name="168717600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717600">(Jun 21 2019 at 21:19)</a>:</h4>
<p>it is clear for me except on the "dispatch back to rustc", to which method?</p>



<a name="168717702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717702">(Jun 21 2019 at 21:21)</a>:</h4>
<p><code>binop</code>-something</p>



<a name="168717705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717705">(Jun 21 2019 at 21:21)</a>:</h4>
<p>ok</p>



<a name="168717707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717707">(Jun 21 2019 at 21:21)</a>:</h4>
<p>they are all in <code>operand.rs</code></p>



<a name="168717708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717708">(Jun 21 2019 at 21:21)</a>:</h4>
<p>eh</p>



<a name="168717709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168717709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168717709">(Jun 21 2019 at 21:21)</a>:</h4>
<p><code>operator.rs</code></p>



<a name="168718217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168718217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168718217">(Jun 21 2019 at 21:30)</a>:</h4>
<p>I tried to dispatch to <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_mir/interpret/operator.rs.html#108" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_mir/interpret/operator.rs.html#108">https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_mir/interpret/operator.rs.html#108</a></p>



<a name="168718338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168718338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168718338">(Jun 21 2019 at 21:31)</a>:</h4>
<p>but it is private D:</p>



<a name="168742902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168742902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168742902">(Jun 22 2019 at 08:42)</a>:</h4>
<p>try <code>binary_op</code></p>



<a name="168742910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168742910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168742910">(Jun 22 2019 at 08:43)</a>:</h4>
<p>or should we make it public? not sure what I prefer</p>



<a name="168750508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168750508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168750508">(Jun 22 2019 at 13:01)</a>:</h4>
<p>What layout should I use to build the ImmTy?</p>



<a name="168753013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168753013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168753013">(Jun 22 2019 at 14:24)</a>:</h4>
<blockquote>
<p>What layout should I use to build the ImmTy?</p>
</blockquote>
<p>Solved :P</p>



<a name="168753151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168753151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168753151">(Jun 22 2019 at 14:29)</a>:</h4>
<p>I broke the hashmap test, I'm trying to see why</p>



<a name="168763225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168763225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168763225">(Jun 22 2019 at 19:57)</a>:</h4>
<p>Apparently it only happens in local, CI is fine</p>



<a name="168850299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850299">(Jun 24 2019 at 13:42)</a>:</h4>
<p>Hi Oliver, Ralf</p>



<a name="168850325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850325">(Jun 24 2019 at 13:43)</a>:</h4>
<p>aloha</p>



<a name="168850329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850329">(Jun 24 2019 at 13:43)</a>:</h4>
<p>I'm going to do the corrections Oliver stated on GH</p>



<a name="168850344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850344">(Jun 24 2019 at 13:43)</a>:</h4>
<p>After that is there something else to be done?</p>



<a name="168850420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850420">(Jun 24 2019 at 13:44)</a>:</h4>
<p>I think it's ready implementation wise, so we can merge after that</p>



<a name="168850467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850467">(Jun 24 2019 at 13:44)</a>:</h4>
<p>Great!</p>



<a name="168850473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850473">(Jun 24 2019 at 13:44)</a>:</h4>
<p>You can notice that something is ready if the reviewer only has naming and other convention complaints left to give off ;)</p>



<a name="168850500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850500">(Jun 24 2019 at 13:44)</a>:</h4>
<p>:P</p>



<a name="168850793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168850793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168850793">(Jun 24 2019 at 13:48)</a>:</h4>
<p>I was thinking about the <code>push</code> vs <code>binary_search</code>. On one had it is nice to be completely sure that elements would be added in order and avoid the overhead of searching. On the other hand, modifications in the future could break this (although Ralf suggested that this is unlikely to change in the future)</p>



<a name="168854603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854603">(Jun 24 2019 at 14:33)</a>:</h4>
<p>I just think it's a lot of effort</p>



<a name="168854620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854620">(Jun 24 2019 at 14:33)</a>:</h4>
<p>especially if the list grows</p>



<a name="168854715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854715">(Jun 24 2019 at 14:34)</a>:</h4>
<p>I'll use <code>push</code> and do a comment</p>



<a name="168854728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854728">(Jun 24 2019 at 14:35)</a>:</h4>
<p>could you explain the page size <code>FIXME</code>?</p>



<a name="168854828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854828">(Jun 24 2019 at 14:36)</a>:</h4>
<p>the 2^16 is an arbitrary pick by me</p>



<a name="168854845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854845">(Jun 24 2019 at 14:36)</a>:</h4>
<p>I think most operating systems use a single memory page</p>



<a name="168854862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854862">(Jun 24 2019 at 14:36)</a>:</h4>
<p>So you want to initialize the <code>base_addr</code> in exactly the page size?</p>



<a name="168854921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854921">(Jun 24 2019 at 14:37)</a>:</h4>
<p>yea</p>



<a name="168854997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168854997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168854997">(Jun 24 2019 at 14:38)</a>:</h4>
<p>Why is that important?</p>



<a name="168855002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168855002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168855002">(Jun 24 2019 at 14:38)</a>:</h4>
<p>I mean</p>



<a name="168855021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168855021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168855021">(Jun 24 2019 at 14:38)</a>:</h4>
<p>oh it isn't very important, just represents the OS behaviour better</p>



<a name="168855033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168855033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168855033">(Jun 24 2019 at 14:38)</a>:</h4>
<p>I understand it is important to start with an address that in fact exists</p>



<a name="168855035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168855035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168855035">(Jun 24 2019 at 14:38)</a>:</h4>
<p>oh ok</p>



<a name="168857277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168857277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168857277">(Jun 24 2019 at 15:03)</a>:</h4>
<p>we're good to go</p>



<a name="168879166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879166">(Jun 24 2019 at 19:45)</a>:</h4>
<p>I just left you a bunch of comments :)</p>



<a name="168879325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879325">(Jun 24 2019 at 19:48)</a>:</h4>
<p>Yayyy</p>



<a name="168879371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879371">(Jun 24 2019 at 19:48)</a>:</h4>
<p>thank you Ralf</p>



<a name="168879389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879389">(Jun 24 2019 at 19:48)</a>:</h4>
<p>sorry it took me so long. wanted to do it yesterday but then I did a bike trip instead.^^</p>



<a name="168879410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879410">(Jun 24 2019 at 19:48)</a>:</h4>
<p>Don't worry, bike riding is rad :P</p>



<a name="168879421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879421">(Jun 24 2019 at 19:49)</a>:</h4>
<p>completely understandable</p>



<a name="168879933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168879933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168879933">(Jun 24 2019 at 19:55)</a>:</h4>
<p>To initialize <code>MemoryExtra</code> with the <code>rng</code>, we would need to modify <code>InterpretCx</code> and <code>Memory</code> constructors to receive the <code>rng</code>. That seems to be to specific to be done there. Do you have any other route in mind?</p>



<a name="168880383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168880383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168880383">(Jun 24 2019 at 20:00)</a>:</h4>
<p>seems like a TODO for later... what I think should happen is that the <code>InterpretCx</code> constructor takes the initial <code>MemoryExtra</code> as argument</p>



<a name="168880413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168880413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168880413">(Jun 24 2019 at 20:00)</a>:</h4>
<p>sounds good, I'll do it later this week</p>



<a name="168881212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168881212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168881212">(Jun 24 2019 at 20:11)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>  what kind of bounds do you mean? <a href="https://github.com/rust-lang/miri/pull/779/files/2861ceb2fa1acc2c642abd4f2efb96c713a47e29#r296879361" target="_blank" title="https://github.com/rust-lang/miri/pull/779/files/2861ceb2fa1acc2c642abd4f2efb96c713a47e29#r296879361">https://github.com/rust-lang/miri/pull/779/files/2861ceb2fa1acc2c642abd4f2efb96c713a47e29#r296879361</a></p>



<a name="168881288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168881288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168881288">(Jun 24 2019 at 20:12)</a>:</h4>
<p>oh this is the case where we have an exact hit so the offset is 0?</p>



<a name="168881290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168881290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168881290">(Jun 24 2019 at 20:12)</a>:</h4>
<p>that <code>pos</code> is smaller than  the size of the array?</p>



<a name="168881295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168881295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168881295">(Jun 24 2019 at 20:12)</a>:</h4>
<blockquote>
<p>oh this is the case where we have an exact hit so the offset is 0?</p>
</blockquote>
<p>yes</p>



<a name="168881305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168881305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168881305">(Jun 24 2019 at 20:12)</a>:</h4>
<p>then please add a comment saying so :)</p>



<a name="168933158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168933158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168933158">(Jun 25 2019 at 12:26)</a>:</h4>
<blockquote>
<p>we'll need to compute the next address here that is divisble by the alignment, but not by the next higher alignment.</p>
</blockquote>
<p>is the alignment <code>std::mem::align_of::&lt;usize&gt;()</code>?</p>



<a name="168934122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168934122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168934122">(Jun 25 2019 at 12:40)</a>:</h4>
<p>The next immediate address that is aligned with <code>alignment</code> should be something like:</p>
<div class="codehilite"><pre><span></span><span class="n">global_state</span><span class="p">.</span><span class="n">next_base_addr</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">global_state</span><span class="p">.</span><span class="n">next_base_addr</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="n">alignment</span><span class="p">;</span><span class="w"></span>
</pre></div>


<p>this should be exactly divisible by <code>alignment</code>. Is that enough?</p>



<a name="168934992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168934992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168934992">(Jun 25 2019 at 12:52)</a>:</h4>
<p>Also, shouldn't be better to keep <code>next_base_addr</code> always aligned? I mean, instead of aligning when needed, shouldn't be better to align beforehand to keep <code>next_base_addr</code> alignment as an invariant?</p>



<a name="168936278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168936278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168936278">(Jun 25 2019 at 13:07)</a>:</h4>
<p>isn't it <code>global_state.next_base_addr + alignment - global_state.next_base_addr % alignment</code> assuming <code>global_state.next_base_addr % alignment</code> isn't <code>0</code>?</p>



<a name="168938074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168938074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168938074">(Jun 25 2019 at 13:29)</a>:</h4>
<p>Oh yeah it is, my bad. Are my other assumptions correct?</p>



<a name="168945596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168945596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168945596">(Jun 25 2019 at 14:52)</a>:</h4>
<p>Also I tried to reproduce your misalignment  but it fails at the assertion. I understood the assert should succeed</p>



<a name="168945958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168945958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168945958">(Jun 25 2019 at 14:55)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="mi">5</span><span class="k">u8</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">usize</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="mi">6</span><span class="k">u16</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">u16</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">usize</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="n">assert</span><span class="o">!</span><span class="p">(</span><span class="n">y</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span><span class="w"></span>
</pre></div>


<p>this one</p>



<a name="168949234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168949234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168949234">(Jun 25 2019 at 15:36)</a>:</h4>
<blockquote>
<p>Also, shouldn't be better to keep <code>next_base_addr</code> always aligned? I mean, instead of aligning when needed, shouldn't be better to align beforehand to keep <code>next_base_addr</code> alignment as an invariant?</p>
</blockquote>
<p>dis doesnt make sense, i just understood</p>



<a name="168949496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168949496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168949496">(Jun 25 2019 at 15:40)</a>:</h4>
<blockquote>
<p>is the alignment <code>std::mem::align_of::&lt;usize&gt;()</code>?</p>
</blockquote>
<p>i just discovered <code>alloc.align</code></p>



<a name="168949947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168949947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168949947">(Jun 25 2019 at 15:46)</a>:</h4>
<p>The assert should fail, buy I think it's succeeding atm?</p>



<a name="168951026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168951026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168951026">(Jun 25 2019 at 16:01)</a>:</h4>
<p>it is failing at the moment</p>



<a name="168951105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168951105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168951105">(Jun 25 2019 at 16:02)</a>:</h4>
<p>and after doing the alignment tweaks it also fails</p>



<a name="168951135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168951135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168951135">(Jun 25 2019 at 16:02)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">align</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">alloc</span><span class="p">.</span><span class="n">align</span><span class="p">.</span><span class="n">bytes</span><span class="p">();</span><span class="w"></span>
<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">base_addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">global_state</span><span class="p">.</span><span class="n">next_base_addr</span><span class="p">;</span><span class="w"></span>

<span class="w">                </span><span class="c1">// Align the address with the allocation</span>
<span class="w">                </span><span class="n">base_addr</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">align</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">base_addr</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="n">align</span><span class="p">;</span><span class="w"></span>
<span class="w">                </span><span class="n">global_state</span><span class="p">.</span><span class="n">next_base_addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">base_addr</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">alloc</span><span class="p">.</span><span class="n">bytes</span><span class="p">.</span><span class="n">len</span><span class="p">()</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="kt">u64</span><span class="p">;</span><span class="w"></span>
<span class="w">                </span><span class="n">alloc</span><span class="p">.</span><span class="n">extra</span><span class="p">.</span><span class="n">intptrcast</span><span class="p">.</span><span class="n">base_addr</span><span class="p">.</span><span class="n">set</span><span class="p">(</span><span class="nb">Some</span><span class="p">(</span><span class="n">base_addr</span><span class="p">));</span><span class="w"></span>

<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">elem</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">base_addr</span><span class="p">,</span><span class="w"> </span><span class="n">ptr</span><span class="p">.</span><span class="n">alloc_id</span><span class="p">);</span><span class="w"></span>

<span class="w">                </span><span class="c1">// Given that `next_base_addr` increases in each allocation, pushing the</span>
<span class="w">                </span><span class="c1">// corresponding tuple keeps `int_to_ptr_map` sorted</span>
<span class="w">                </span><span class="n">global_state</span><span class="p">.</span><span class="n">int_to_ptr_map</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span><span class="w"></span>

<span class="w">                </span><span class="n">base_addr</span><span class="w"></span>
</pre></div>


<p>these are the changes</p>



<a name="168951292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168951292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168951292">(Jun 25 2019 at 16:04)</a>:</h4>
<p>I'd like to have a test to avoid breaking the alignment like the one you suggested but i'm not sure why it does not break without fixing the alignment.</p>



<a name="168952021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952021">(Jun 25 2019 at 16:13)</a>:</h4>
<p>please factor that "rounding up the integer to the next multiple" into a separate method, for readability</p>



<a name="168952026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952026">(Jun 25 2019 at 16:13)</a>:</h4>
<p>I'm surprised libcore doesn't already have that?</p>



<a name="168952034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952034">(Jun 25 2019 at 16:13)</a>:</h4>
<p>maybe it does and I haven't discovered it yet :P</p>



<a name="168952151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952151">(Jun 25 2019 at 16:14)</a>:</h4>
<p>can't find one either though^^</p>



<a name="168952204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952204">(Jun 25 2019 at 16:15)</a>:</h4>
<p>Yea, there's only <code>next_power_of_2</code> or sth like that</p>



<a name="168952283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952283">(Jun 25 2019 at 16:16)</a>:</h4>
<p>Why is it failing atm. ..</p>



<a name="168952305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952305">(Jun 25 2019 at 16:16)</a>:</h4>
<p>Oh maybe there are preceding allocations that do ptr to iny</p>



<a name="168952340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952340">(Jun 25 2019 at 16:17)</a>:</h4>
<p>Did you run with the seed flag? And it's the assert that fails?</p>



<a name="168952375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952375">(Jun 25 2019 at 16:17)</a>:</h4>
<p>Try doing the same assert for the first pointer</p>



<a name="168952386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952386">(Jun 25 2019 at 16:17)</a>:</h4>
<p>So on <code>x</code></p>



<a name="168952643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952643">(Jun 25 2019 at 16:20)</a>:</h4>
<blockquote>
<p>Did you run with the seed flag? And it's the assert that fails?</p>
</blockquote>
<p>yes</p>



<a name="168952716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952716">(Jun 25 2019 at 16:21)</a>:</h4>
<blockquote>
<p>Try doing the same assert for the first pointer</p>
</blockquote>
<p>Loading <span aria-label="clock" class="emoji emoji-1f557" role="img" title="clock">:clock:</span></p>



<a name="168952822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168952822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168952822">(Jun 25 2019 at 16:23)</a>:</h4>
<blockquote>
<p>please factor that "rounding up the integer to the next multiple" into a separate method, for readability</p>
</blockquote>
<p>Done :D</p>



<a name="168953120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168953120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168953120">(Jun 25 2019 at 16:26)</a>:</h4>
<p><code>assert!(x % 2 == 1);</code> also fails with and without doing the alignment</p>



<a name="168972744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168972744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168972744">(Jun 25 2019 at 20:12)</a>:</h4>
<p>Other than deciding what to do with the alignment tests we are ready to go</p>



<a name="168973151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973151">(Jun 25 2019 at 20:17)</a>:</h4>
<p>I have no clue what's going on</p>



<a name="168973163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973163">(Jun 25 2019 at 20:17)</a>:</h4>
<p>Oh well</p>



<a name="168973268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973268">(Jun 25 2019 at 20:18)</a>:</h4>
<p><code>// FIXME: Here be misaligned dragons</code></p>



<a name="168973312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973312">(Jun 25 2019 at 20:19)</a>:</h4>
<p>Heh</p>



<a name="168973324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973324">(Jun 25 2019 at 20:19)</a>:</h4>
<p>Open an issue pls</p>



<a name="168973335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973335">(Jun 25 2019 at 20:19)</a>:</h4>
<p>Then r=me</p>



<a name="168973356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168973356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168973356">(Jun 25 2019 at 20:19)</a>:</h4>
<p>what does r= does?</p>



<a name="168978602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168978602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168978602">(Jun 25 2019 at 21:20)</a>:</h4>
<p>Oh that just means I'll merge or someone can merge in my name</p>



<a name="168980403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168980403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168980403">(Jun 25 2019 at 21:45)</a>:</h4>
<p>I opened the ticket and did the corrections that  <span class="user-mention" data-user-id="120791">@RalfJ</span>  suggested</p>



<a name="168980641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/168980641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#168980641">(Jun 25 2019 at 21:48)</a>:</h4>
<p>I made a fool of myself by doing r=oli-obk. Bors slapped me with a nice  "This incident will be reported" :P</p>



<a name="169005887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169005887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169005887">(Jun 26 2019 at 07:21)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> <a href="https://xkcd.com/838/" target="_blank" title="https://xkcd.com/838/">https://xkcd.com/838/</a> ;)</p>



<a name="169006124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169006124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169006124">(Jun 26 2019 at 07:26)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> <code>addr + align - addr % align</code> will return <code>addr + align</code> if <code>addr</code> is divisible by <code>align</code>. How is that "rounding up to the next multiple (that's &gt;= addr)"?</p>



<a name="169031117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169031117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169031117">(Jun 26 2019 at 13:47)</a>:</h4>
<p>Oh damn, it's just strictly larger</p>



<a name="169031210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169031210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169031210">(Jun 26 2019 at 13:48)</a>:</h4>
<p>Sorry yesterday I had trouble sleeping and I was more clumsy than usual</p>



<a name="169032303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169032303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169032303">(Jun 26 2019 at 13:57)</a>:</h4>
<p>So <span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="124288">@oli</span>, is there anything else after fixing that?</p>



<a name="169078744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078744">(Jun 26 2019 at 20:51)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> let's continue here, this is off-topic in the other topic ;)</p>



<a name="169078753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078753">(Jun 26 2019 at 20:51)</a>:</h4>
<p>casts are in <code>librustc_mir/interpret/cast.rs</code></p>



<a name="169078757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078757">(Jun 26 2019 at 20:51)</a>:</h4>
<p>yep sorry haha</p>



<a name="169078808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078808">(Jun 26 2019 at 20:52)</a>:</h4>
<p>for ptr-to-int casts (of any size) you'll have to do something like "try <code>force_bits</code> but if that fails continue with the existing code path"</p>



<a name="169078829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078829">(Jun 26 2019 at 20:52)</a>:</h4>
<p>like, <code>match force_bits(...) { Ok(...) =&gt; ..., Err(...) =&gt; ... }</code></p>



<a name="169078834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169078834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169078834">(Jun 26 2019 at 20:52)</a>:</h4>
<p>ok</p>



<a name="169080937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169080937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169080937">(Jun 26 2019 at 21:17)</a>:</h4>
<p>I'm inside <code>cast.rs</code>, I suppose that the <code>cast</code>method is the entrypoint here. Should we use <code>force_bits</code> in for every <code>PointerCast</code> variant?</p>



<a name="169081406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169081406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169081406">(Jun 26 2019 at 21:22)</a>:</h4>
<p>your entry point is <code>cast_scalar</code></p>



<a name="169081421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169081421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169081421">(Jun 26 2019 at 21:22)</a>:</h4>
<p>(I'd like to clean up <code>cast</code> at some point but not now^^)</p>



<a name="169081513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169081513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169081513">(Jun 26 2019 at 21:23)</a>:</h4>
<p>in <code>cast_from_int</code>, there's a case where we cast <em>to</em> <code>RawPtr</code>, that's... interesting but I am not sure what we want to do there so let's ignore it for now</p>



<a name="169081570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169081570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169081570">(Jun 26 2019 at 21:24)</a>:</h4>
<p>so <code>cast_from_ptr</code> is where you want to do your thing</p>



<a name="169082009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169082009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169082009">(Jun 26 2019 at 21:28)</a>:</h4>
<p>Oh ok that seems pretty straightforward.</p>



<a name="169083640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169083640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169083640">(Jun 26 2019 at 21:48)</a>:</h4>
<p>How should I get the size of the target type? I thought I could use <code>tcx</code> to get the layout but it seems a little complicated</p>



<a name="169083957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169083957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169083957">(Jun 26 2019 at 21:53)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.IntTy.html#method.bit_width" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.IntTy.html#method.bit_width">https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.IntTy.html#method.bit_width</a></p>



<a name="169083969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169083969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169083969">(Jun 26 2019 at 21:53)</a>:</h4>
<p>and <a href="https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.UintTy.html#method.bit_width" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.UintTy.html#method.bit_width">https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/enum.UintTy.html#method.bit_width</a></p>



<a name="169083982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169083982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169083982">(Jun 26 2019 at 21:53)</a>:</h4>
<p>oh great</p>



<a name="169083992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169083992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169083992">(Jun 26 2019 at 21:53)</a>:</h4>
<p>which are methods on the <code>i</code> in <code>Int(i)</code> and <code>Uint(i)</code></p>



<a name="169084002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169084002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169084002">(Jun 26 2019 at 21:53)</a>:</h4>
<p>(where we have <code>_</code> or <code>Isize</code>/<code>Usize</code> so far)</p>



<a name="169084309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169084309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169084309">(Jun 26 2019 at 21:58)</a>:</h4>
<p>yeah ok</p>



<a name="169084406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169084406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169084406">(Jun 26 2019 at 21:59)</a>:</h4>
<p>I think bors needs a little bit of rest: <a href="https://github.com/rust-lang/rust/pull/62158" target="_blank" title="https://github.com/rust-lang/rust/pull/62158">https://github.com/rust-lang/rust/pull/62158</a></p>



<a name="169084677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169084677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169084677">(Jun 26 2019 at 22:03)</a>:</h4>
<blockquote>
<p>which are methods on the <code>i</code> in <code>Int(i)</code> and <code>Uint(i)</code></p>
</blockquote>
<p>and what about <code>isize</code> and <code>usize</code>, should I use 64?</p>



<a name="169084758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169084758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169084758">(Jun 26 2019 at 22:04)</a>:</h4>
<p>no you should use <code>self.memory.pointer_size()</code></p>



<a name="169085466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085466">(Jun 26 2019 at 22:14)</a>:</h4>
<p>Hahhahaha</p>



<a name="169085475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085475">(Jun 26 2019 at 22:14)</a>:</h4>
<p>santa is not comming here this year <a href="https://github.com/rust-lang/rust/pull/62158#issuecomment-506064431" target="_blank" title="https://github.com/rust-lang/rust/pull/62158#issuecomment-506064431">https://github.com/rust-lang/rust/pull/62158#issuecomment-506064431</a></p>



<a name="169085757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085757">(Jun 26 2019 at 22:18)</a>:</h4>
<p>bors is very over-eager and any time you mention his name he thinks it's a command, even in <code>code blocks</code> or quotes. ;)</p>



<a name="169085781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085781">(Jun 26 2019 at 22:19)</a>:</h4>
<p>yeah.. "Today I learned"</p>



<a name="169085783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085783">(Jun 26 2019 at 22:19)</a>:</h4>
<p>however, it seems my "delegate" failed because it was in a review approval, not a comment...</p>



<a name="169085792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169085792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169085792">(Jun 26 2019 at 22:19)</a>:</h4>
<p>great, now you owe me a christmas gift</p>



<a name="169086535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169086535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169086535">(Jun 26 2019 at 22:30)</a>:</h4>
<p><span aria-label="gift" class="emoji emoji-1f381" role="img" title="gift">:gift:</span></p>



<a name="169086587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169086587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169086587">(Jun 26 2019 at 22:31)</a>:</h4>
<p>I did the change to <code>cast_from_ptr</code>. I'm running tests to check if something broke</p>



<a name="169087602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169087602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169087602">(Jun 26 2019 at 22:46)</a>:</h4>
<p>So the following tests broke: </p>
<div class="codehilite"><pre><span></span>    [ui] ui/consts/const-eval/const_raw_ptr_ops.rs
    [ui] ui/consts/const-eval/issue-52442.rs
    [ui] ui/consts/const-eval/match-test-ptr-null.rs
    [ui] ui/issues/issue-52023-array-size-pointer-cast.rs
</pre></div>


<p>I think most of them are ok because the errors when doing  <code>ptr as usize</code> changed to <code>PointerAsBytes</code>. However,  the error when doing <code>&amp;loop { break }</code> changed from <code>it is undefined behavior to use this value</code> to <code>evaluation of constant value failed</code> inside <code>issue-52442.rs</code></p>



<a name="169087647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169087647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169087647">(Jun 26 2019 at 22:47)</a>:</h4>
<p>remember that Miri might run with or without ptr-to-int support</p>



<a name="169087653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169087653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169087653">(Jun 26 2019 at 22:47)</a>:</h4>
<p>that's why I said you need to catch the <code>Err</code></p>



<a name="169087656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169087656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169087656">(Jun 26 2019 at 22:47)</a>:</h4>
<p>which it seems you did not?</p>



<a name="169088098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169088098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169088098">(Jun 26 2019 at 22:55)</a>:</h4>
<p>let me find a way of doing it without being redundant</p>



<a name="169089446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169089446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169089446">(Jun 26 2019 at 23:16)</a>:</h4>
<p>so basically <code>ptr as usize</code> and <code>ptr as isize</code> will try to use <code>force_bits</code> and if it fails, then they will return <code>ptr.into()</code></p>



<a name="169089457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169089457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169089457">(Jun 26 2019 at 23:17)</a>:</h4>
<p>to keep the old behaviour</p>



<a name="169090984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169090984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169090984">(Jun 26 2019 at 23:45)</a>:</h4>
<p>ok now <code>to_bits_or_ptr</code> inside <code>librustc\mir\interpret\value.rs</code> panicked when running <code>run-pass/cast-rfc0401.rs</code>. I'm going to push this code so you can see what's going on</p>



<a name="169091222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169091222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169091222">(Jun 26 2019 at 23:50)</a>:</h4>
<p><a href="https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8" target="_blank" title="https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8">https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8</a></p>



<a name="169201956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169201956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169201956">(Jun 28 2019 at 06:37)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> wait in <a href="https://github.com/rust-lang/rust/pull/62158#issuecomment-506620125" target="_blank" title="https://github.com/rust-lang/rust/pull/62158#issuecomment-506620125">https://github.com/rust-lang/rust/pull/62158#issuecomment-506620125</a> you linked to the PR itself?</p>



<a name="169201960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169201960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169201960">(Jun 28 2019 at 06:37)</a>:</h4>
<p>did you mean the corresponding Miri PR?</p>



<a name="169201961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169201961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169201961">(Jun 28 2019 at 06:37)</a>:</h4>
<p>Oh lol</p>



<a name="169202007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169202007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169202007">(Jun 28 2019 at 06:38)</a>:</h4>
<p>I fixed the comment, dont tell anyone</p>



<a name="169204238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169204238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169204238">(Jun 28 2019 at 07:28)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  <a href="https://github.com/rust-lang/miri/issues/224#issuecomment-506631948" target="_blank" title="https://github.com/rust-lang/miri/issues/224#issuecomment-506631948">https://github.com/rust-lang/miri/issues/224#issuecomment-506631948</a> you mean like being able to just enable intptrcast in one direction?</p>



<a name="169204951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169204951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169204951">(Jun 28 2019 at 07:45)</a>:</h4>
<blockquote>
<p><a href="https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8" target="_blank" title="https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8">https://github.com/christianpoveda/rust/commit/e1e95a83861271e144f65903c652ab9fa9bd64b8</a></p>
</blockquote>
<p>I think this does what we want but we can make it a bit less messy but better preserving the original structure of the <code>match</code></p>



<a name="169205004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205004">(Jun 28 2019 at 07:46)</a>:</h4>
<p>It does not, when the size of the types is different it fails</p>



<a name="169205008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205008">(Jun 28 2019 at 07:46)</a>:</h4>
<p>please define a helper method that does something like</p>
<div class="codehilite"><pre><span></span>fn int_size(ty) -&gt; Option&lt;...&gt; {
match ty {  Int(i) =&gt; i.bit_width(),
            Uint(i) =&gt; i.bit_width(),
_ =&gt; bug!(&quot;This is not an int&quot;),
}
</pre></div>



<a name="169205017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205017">(Jun 28 2019 at 07:46)</a>:</h4>
<p>then you can, I think, stick to an outermost <code>match</code> and only have code inside the branches, instead of after the match</p>



<a name="169205023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205023">(Jun 28 2019 at 07:46)</a>:</h4>
<p>I though about that but didn't feel that comfortable creating new methods here and there, I'm still shy on that. Will do :)</p>



<a name="169205033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205033">(Jun 28 2019 at 07:47)</a>:</h4>
<p>you can just do that locally</p>



<a name="169205040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205040">(Jun 28 2019 at 07:47)</a>:</h4>
<p>make it a helper method defined <em>inside</em> <code>cast_from_ptr</code></p>



<a name="169205049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205049">(Jun 28 2019 at 07:47)</a>:</h4>
<p>Ok I will fix that, however I'm still worried about the test that this broke</p>



<a name="169205086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205086">(Jun 28 2019 at 07:48)</a>:</h4>
<p>it's a trade-off between matching twice and overall code structure, and I agree it's not clear-cut. I think matching twice, if once is done ina  helper method, is nicer though.</p>



<a name="169205091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205091">(Jun 28 2019 at 07:48)</a>:</h4>
<p>this broke a test?</p>



<a name="169205093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205093">(Jun 28 2019 at 07:48)</a>:</h4>
<p>yep</p>



<a name="169205106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205106">(Jun 28 2019 at 07:48)</a>:</h4>
<blockquote>
<p>ok now <code>to_bits_or_ptr</code> inside <code>librustc\mir\interpret\value.rs</code> panicked when running <code>run-pass/cast-rfc0401.rs</code>. I'm going to push this code so you can see what's going on</p>
</blockquote>
<p>here</p>



<a name="169205182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205182">(Jun 28 2019 at 07:50)</a>:</h4>
<p>the thing is that <code>cast-rfc0401</code> has a lot of casts :P so I was not sure about which one panicked. IIRC the problem was that the sizes did not match, one was 2 and the other one 4, so probably something from u16 to u32</p>



<a name="169205477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205477">(Jun 28 2019 at 07:56)</a>:</h4>
<p>I'll do the change to make the code more readable for the moment</p>



<a name="169205756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205756">(Jun 28 2019 at 08:01)</a>:</h4>
<p>do you have panic message + stacktrace?</p>



<a name="169205774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205774">(Jun 28 2019 at 08:01)</a>:</h4>
<p>Not right now, let me reproduce it</p>



<a name="169205823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205823">(Jun 28 2019 at 08:02)</a>:</h4>
<p>also if you run rustc with <code>RUSTC_LOG=rustc_mir::interpret=info</code> you should get a better clue of where in the interpreted program it failed</p>



<a name="169205839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205839">(Jun 28 2019 at 08:02)</a>:</h4>
<p>ohhh nice trick</p>



<a name="169205840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169205840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169205840">(Jun 28 2019 at 08:02)</a>:</h4>
<p>didn't know that</p>



<a name="169207789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169207789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169207789">(Jun 28 2019 at 08:41)</a>:</h4>
<p>Ok, found the error, time to get the traces</p>



<a name="169208130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169208130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169208130">(Jun 28 2019 at 08:47)</a>:</h4>
<p>I'm overwhelmed by the ammount of lines in this :P. I have the gut feeling that this:</p>
<div class="codehilite"><pre><span></span> INFO 2019-06-28T08:41:50Z: rustc_mir::interpret::step: _1 = (const &quot;/home/christian/Workspace/contrib/rust/src/test/run-pass/cast-rfc0401.rs&quot;, const 147u32, const 5u32)
</pre></div>


<p>Is telling me the line that is being executed but I'm not sure why</p>



<a name="169208507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169208507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169208507">(Jun 28 2019 at 08:53)</a>:</h4>
<p>Ok yep, here is the problem (or at least that's what my nonexistent experience reading this tells me)</p>



<a name="169208511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169208511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169208511">(Jun 28 2019 at 08:53)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">first</span><span class="w"> </span>: <span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span><span class="w"></span>

<span class="w">    </span><span class="n">assert_eq</span><span class="o">!</span><span class="p">(</span><span class="n">first</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="n">_</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="n">assert_eq</span><span class="o">!</span><span class="p">(</span><span class="n">first</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="o">*</span><span class="k">const</span><span class="w"> </span><span class="kt">u32</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="169208679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169208679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169208679">(Jun 28 2019 at 08:56)</a>:</h4>
<p>And the actual error is:</p>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;assertion failed: `(left == right)`
  left: `Size { raw: 2 }`,
 right: `Size { raw: 8 }`&#39;, src/librustc/mir/interpret/value.rs:367:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
</pre></div>



<a name="169227072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169227072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169227072">(Jun 28 2019 at 14:03)</a>:</h4>
<p>Probably I'm wrong and the error is not there because the sizes do not make sense to me</p>



<a name="169239773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239773">(Jun 28 2019 at 16:24)</a>:</h4>
<p>that looks like you are asking for a ptr-sized value and got one of size 2</p>



<a name="169239802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239802">(Jun 28 2019 at 16:25)</a>:</h4>
<p>a rustc stacktrace would still be useful</p>



<a name="169239811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239811">(Jun 28 2019 at 16:25)</a>:</h4>
<p>let met get it</p>



<a name="169239812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239812">(Jun 28 2019 at 16:25)</a>:</h4>
<p>the <code>RUST_BACKTRACE=1</code> thing</p>



<a name="169239866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239866">(Jun 28 2019 at 16:25)</a>:</h4>
<p>as for the long log, yes it's huge ;)</p>



<a name="169239871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239871">(Jun 28 2019 at 16:25)</a>:</h4>
<p>can you take the last 50 lines or so and paste them in a gist or so?</p>



<a name="169239924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239924">(Jun 28 2019 at 16:26)</a>:</h4>
<p>Sorry, I'm in other machine ATM</p>



<a name="169239931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169239931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169239931">(Jun 28 2019 at 16:26)</a>:</h4>
<p>so I'll have to compile/run tests and so on so it will take a while</p>



<a name="169242172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242172">(Jun 28 2019 at 16:56)</a>:</h4>
<p>dont worry, I need to have dinner first anyway ;)</p>



<a name="169242185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242185">(Jun 28 2019 at 16:56)</a>:</h4>
<p>and then move my stuff down to the basement where temperatures are survivable</p>



<a name="169242192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242192">(Jun 28 2019 at 16:56)</a>:</h4>
<p>Lecker! :)</p>



<a name="169242223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242223">(Jun 28 2019 at 16:57)</a>:</h4>
<blockquote>
<p>and then move my stuff down to the basement where temperatures are survivable</p>
</blockquote>
<p>I got a mail at work telling me that one of the clusters in spain went down because the oil refrigeration is failing because of the heat wave</p>



<a name="169242639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242639">(Jun 28 2019 at 17:02)</a>:</h4>
<p>oO</p>



<a name="169242661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242661">(Jun 28 2019 at 17:03)</a>:</h4>
<p>on Sunday there's some chance we might see a new all-time-ever record for the highest temperature in Germany</p>



<a name="169242677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242677">(Jun 28 2019 at 17:03)</a>:</h4>
<p>(well, ever = for the last 100-150 years or so, where we have records)</p>



<a name="169242855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242855">(Jun 28 2019 at 17:05)</a>:</h4>
<p>I think is safe to assume that even without data, there is no way such high temperatures could be reached since a long time ago</p>



<a name="169242886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242886">(Jun 28 2019 at 17:05)</a>:</h4>
<p>as usual, up to a small probability. ;)</p>



<a name="169242932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242932">(Jun 28 2019 at 17:06)</a>:</h4>
<p>statistics and probability distributions are great</p>



<a name="169242961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169242961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169242961">(Jun 28 2019 at 17:06)</a>:</h4>
<p>but I agree. it's a <em>very</em> small probability.</p>



<a name="169248324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169248324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169248324">(Jun 28 2019 at 18:08)</a>:</h4>
<p>Ok I have the logs now</p>



<a name="169248435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169248435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169248435">(Jun 28 2019 at 18:10)</a>:</h4>
<p>here is the rustc backtrace</p>



<a name="169248438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169248438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169248438">(Jun 28 2019 at 18:10)</a>:</h4>
<p><a href="https://gist.github.com/christianpoveda/4287862a77a35bf8ca84a6c7129d6295" target="_blank" title="https://gist.github.com/christianpoveda/4287862a77a35bf8ca84a6c7129d6295">https://gist.github.com/christianpoveda/4287862a77a35bf8ca84a6c7129d6295</a></p>



<a name="169248503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169248503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169248503">(Jun 28 2019 at 18:11)</a>:</h4>
<p>and here the miri logs<br>
<a href="https://gist.github.com/christianpoveda/815b11e267d1b705e52d4ee3a1ad8b12" target="_blank" title="https://gist.github.com/christianpoveda/815b11e267d1b705e52d4ee3a1ad8b12">https://gist.github.com/christianpoveda/815b11e267d1b705e52d4ee3a1ad8b12</a></p>



<a name="169250333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250333">(Jun 28 2019 at 18:32)</a>:</h4>
<p>oh it's in <code>const_prop</code> :(</p>



<a name="169250335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250335">(Jun 28 2019 at 18:33)</a>:</h4>
<p>that's always bad news, that pass is a mess</p>



<a name="169250367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250367">(Jun 28 2019 at 18:33)</a>:</h4>
<p>btw you seem to be building without debug info so there are no line numbers in that backtrace</p>



<a name="169250395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250395">(Jun 28 2019 at 18:33)</a>:</h4>
<p>how should I enable debug info?</p>



<a name="169250396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250396">(Jun 28 2019 at 18:33)</a>:</h4>
<p><code>debuginfo-level = 1</code> is a good thing to have in your <code>config.toml</code></p>



<a name="169250438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250438">(Jun 28 2019 at 18:34)</a>:</h4>
<p>ok nice</p>



<a name="169250442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169250442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169250442">(Jun 28 2019 at 18:34)</a>:</h4>
<p>let me do it</p>



<a name="169251148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251148">(Jun 28 2019 at 18:42)</a>:</h4>
<p>btw, just added the most amazing intrpcast test so far :D <a href="https://github.com/rust-lang/miri/pull/798" target="_blank" title="https://github.com/rust-lang/miri/pull/798">https://github.com/rust-lang/miri/pull/798</a></p>



<a name="169251158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251158">(Jun 28 2019 at 18:42)</a>:</h4>
<p>this is something people have been running into all the time</p>



<a name="169251167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251167">(Jun 28 2019 at 18:43)</a>:</h4>
<p>so it's great that soon this will work in Miri out-of-the-box :)</p>



<a name="169251227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251227">(Jun 28 2019 at 18:43)</a>:</h4>
<p><span aria-label="party ball" class="emoji emoji-1f38a" role="img" title="party ball">:party_ball:</span></p>



<a name="169251387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251387">(Jun 28 2019 at 18:45)</a>:</h4>
<blockquote>
<p><code>debuginfo-level = 1</code> is a good thing to have in your <code>config.toml</code></p>
</blockquote>
<p>I did this but I dont see a difference</p>



<a name="169251460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251460">(Jun 28 2019 at 18:46)</a>:</h4>
<blockquote>
<p>so it's great that soon this will work in Miri out-of-the-box :)</p>
</blockquote>
<p>So, now miri can execute the code needed to print a pointer, right?</p>



<a name="169251541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251541">(Jun 28 2019 at 18:47)</a>:</h4>
<blockquote>
<blockquote>
<p><code>debuginfo-level = 1</code> is a good thing to have in your <code>config.toml</code></p>
</blockquote>
<p>I did this but I dont see a difference</p>
</blockquote>
<p>don't worry about it, the stacktrace is good enough for us for now</p>



<a name="169251552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251552">(Jun 28 2019 at 18:47)</a>:</h4>
<p>ok</p>



<a name="169251553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251553">(Jun 28 2019 at 18:47)</a>:</h4>
<p>you'll have to rebuild <em>everything</em> to see a difference</p>



<a name="169251566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251566">(Jun 28 2019 at 18:47)</a>:</h4>
<blockquote>
<blockquote>
<p>so it's great that soon this will work in Miri out-of-the-box :)</p>
</blockquote>
<p>So, now miri can execute the code needed to print a pointer, right?</p>
</blockquote>
<p>yes :D</p>



<a name="169251579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251579">(Jun 28 2019 at 18:47)</a>:</h4>
<blockquote>
<blockquote>
<blockquote>
<p><code>debuginfo-level = 1</code> is a good thing to have in your <code>config.toml</code></p>
</blockquote>
<p>I did this but I dont see a difference</p>
</blockquote>
<p>don't worry about it, the stacktrace is good enough for us for now</p>
</blockquote>
<p>ok not today</p>



<a name="169251676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251676">(Jun 28 2019 at 18:48)</a>:</h4>
<p>did you run the miri test suite with your cast-patched compiler?</p>



<a name="169251701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251701">(Jun 28 2019 at 18:48)</a>:</h4>
<p>i did not, let me try</p>



<a name="169251740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251740">(Jun 28 2019 at 18:49)</a>:</h4>
<p>oh d'oh I see the problem</p>



<a name="169251768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251768">(Jun 28 2019 at 18:49)</a>:</h4>
<p>you are using the size of the <em>target</em> type to extract the <em>source</em> value</p>



<a name="169251769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251769">(Jun 28 2019 at 18:49)</a>:</h4>
<p>tell me</p>



<a name="169251782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251782">(Jun 28 2019 at 18:50)</a>:</h4>
<blockquote>
<p>you are using the size of the <em>target</em> type to extract the <em>source</em> value</p>
</blockquote>
<p>Loading...</p>



<a name="169251830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251830">(Jun 28 2019 at 18:50)</a>:</h4>
<p>Oh crap</p>



<a name="169251880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251880">(Jun 28 2019 at 18:50)</a>:</h4>
<p>so first of all try to unify the <code>Isize</code>/<code>Usize</code> branch with the other one</p>



<a name="169251883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251883">(Jun 28 2019 at 18:50)</a>:</h4>
<p>I think we talked about that, with thr helper function</p>



<a name="169251924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251924">(Jun 28 2019 at 18:51)</a>:</h4>
<p>then, in that branch, you need always do <code>self.force_bits(Scalar::Ptr(ptr), self.memory.pointer_size())</code></p>



<a name="169251959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169251959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169251959">(Jun 28 2019 at 18:51)</a>:</h4>
<p>if that gives <code>Err</code>, old stuff happens</p>



<a name="169252034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252034">(Jun 28 2019 at 18:52)</a>:</h4>
<p>but if that gives <code>Ok</code>... I think the best bet is to forward to <code>cast_from_int</code></p>



<a name="169252044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252044">(Jun 28 2019 at 18:52)</a>:</h4>
<p>then you dont even need to do all the size matching, I think that function already does ot</p>



<a name="169252063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252063">(Jun 28 2019 at 18:52)</a>:</h4>
<p>Ok let me try</p>



<a name="169252105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252105">(Jun 28 2019 at 18:53)</a>:</h4>
<p>though you'll have to get rid of the <code>src_layout</code> parameter</p>



<a name="169252119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252119">(Jun 28 2019 at 18:53)</a>:</h4>
<p>replace it by a <code>src_signed: bool</code> and <code>src_size: Size</code> or so</p>



<a name="169252467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252467">(Jun 28 2019 at 18:57)</a>:</h4>
<p>There is no way to build the layout to avoid doing that?</p>



<a name="169252508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252508">(Jun 28 2019 at 18:58)</a>:</h4>
<p>you dont want to build a new layout</p>



<a name="169252554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252554">(Jun 28 2019 at 18:58)</a>:</h4>
<p>ok I don't</p>



<a name="169252556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252556">(Jun 28 2019 at 18:58)</a>:</h4>
<p><em>maybe</em> we can use the ptr layout</p>



<a name="169252575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252575">(Jun 28 2019 at 18:58)</a>:</h4>
<p>can you check what <code>abi.is_signed()</code> does for pointers?</p>



<a name="169252607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252607">(Jun 28 2019 at 18:59)</a>:</h4>
<p>you are making the <code>&amp;T</code> directly from the <code>*mut T</code>?</p>



<a name="169252622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252622">(Jun 28 2019 at 18:59)</a>:</h4>
<p>argh sry wrong thread</p>



<a name="169252670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252670">(Jun 28 2019 at 18:59)</a>:</h4>
<div class="codehilite"><pre><span></span>    pub fn is_signed(&amp;self) -&gt; bool {
        match *self {
            Abi::Scalar(ref scal) =&gt; match scal.value {
                Primitive::Int(_, signed) =&gt; signed,
                _ =&gt; false,
            },
            _ =&gt; false,
        }
    }
</pre></div>



<a name="169252762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252762">(Jun 28 2019 at 19:00)</a>:</h4>
<p>so, it probably says unsigned</p>



<a name="169252779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252779">(Jun 28 2019 at 19:01)</a>:</h4>
<p>well that's great news, then I think you can just add a <code>src_layout</code> parameter to <code>cast_from_ptr</code></p>



<a name="169252783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252783">(Jun 28 2019 at 19:01)</a>:</h4>
<p>and forward that</p>



<a name="169252788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252788">(Jun 28 2019 at 19:01)</a>:</h4>
<p>also rename <code>ty</code> to <code>dst_ty</code></p>



<a name="169252995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169252995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169252995">(Jun 28 2019 at 19:03)</a>:</h4>
<p>shouldn't be better to use the whole <code>dest_layout</code> instead of <code>dest_ty</code>  for the sake of symmetry?</p>



<a name="169253326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169253326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169253326">(Jun 28 2019 at 19:07)</a>:</h4>
<p>sure why not</p>



<a name="169253922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169253922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169253922">(Jun 28 2019 at 19:14)</a>:</h4>
<p>It's compiling (<a href="https://xkcd.com/303/" target="_blank" title="https://xkcd.com/303/">https://xkcd.com/303/</a>) but it seems it worked</p>



<a name="169254736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169254736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169254736">(Jun 28 2019 at 19:25)</a>:</h4>
<p>Argh... my build failed and I have to recompile it from scratch</p>



<a name="169257950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169257950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169257950">(Jun 28 2019 at 20:04)</a>:</h4>
<p>ouch</p>



<a name="169289813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169289813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169289813">(Jun 29 2019 at 09:18)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> are you ready for some git foo? :D<br>
<a href="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578" target="_blank" title="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578">https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578</a></p>



<a name="169294347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169294347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169294347">(Jun 29 2019 at 11:58)</a>:</h4>
<p>The horror</p>



<a name="169294357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169294357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169294357">(Jun 29 2019 at 11:58)</a>:</h4>
<p>(please wait a bit before doing that, I am doing stuff TM)</p>



<a name="169294368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169294368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169294368">(Jun 29 2019 at 11:58)</a>:</h4>
<p>also isn't it like the middle of the night in your timezone right now? I thought I had some time for the stuff TM before you came back^^</p>



<a name="169295127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295127">(Jun 29 2019 at 12:20)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> okay done with my stuff</p>



<a name="169295131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295131">(Jun 29 2019 at 12:21)</a>:</h4>
<p>now the instructions I posted there should work :)</p>



<a name="169295906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295906">(Jun 29 2019 at 12:45)</a>:</h4>
<p>It's 7 24</p>



<a name="169295907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295907">(Jun 29 2019 at 12:45)</a>:</h4>
<p>It's 7 24</p>



<a name="169295908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295908">(Jun 29 2019 at 12:45)</a>:</h4>
<p>Ill get out of bed at 7 30</p>



<a name="169295976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169295976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169295976">(Jun 29 2019 at 12:47)</a>:</h4>
<p>that is the middle of the night if you ask me, at least for a weekend :P</p>



<a name="169296024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296024">(Jun 29 2019 at 12:48)</a>:</h4>
<p>also does that mean you are 7:30h behind me? interesting 0.5h offset</p>



<a name="169296044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296044">(Jun 29 2019 at 12:49)</a>:</h4>
<p>Hahaha</p>



<a name="169296045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296045">(Jun 29 2019 at 12:49)</a>:</h4>
<p>Hallo</p>



<a name="169296053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296053">(Jun 29 2019 at 12:49)</a>:</h4>
<p>No, the thing is that zulip broke on my phone and didn't send the message, its 7 50 now</p>



<a name="169296098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296098">(Jun 29 2019 at 12:50)</a>:</h4>
<blockquote>
<p>that is the middle of the night if you ask me, at least for a weekend :P</p>
</blockquote>
<p>I used to think like that but I try to keep my schedule consistent the whole week</p>



<a name="169296119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296119">(Jun 29 2019 at 12:51)</a>:</h4>
<p>lol^^ 7h then, okay. not 9h as I thought it would be. ;)</p>



<a name="169296121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296121">(Jun 29 2019 at 12:51)</a>:</h4>
<p>hehehe</p>



<a name="169296171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296171">(Jun 29 2019 at 12:53)</a>:</h4>
<p>In fact it is pretty handy. My work is done with some people at CERN in Switzerland so we have a clock with the central european time in the office, so I use it secretly to also check what hour is over there to work on Rusty stuff</p>



<a name="169296176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296176">(Jun 29 2019 at 12:53)</a>:</h4>
<p>hehe</p>



<a name="169296178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296178">(Jun 29 2019 at 12:53)</a>:</h4>
<p>and you have to tell me at some point what you are working on, working with CERN sounds awesome :D</p>



<a name="169296184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296184">(Jun 29 2019 at 12:53)</a>:</h4>
<p>I've visited there once. I like physics, so it was a blast :)</p>



<a name="169296186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296186">(Jun 29 2019 at 12:53)</a>:</h4>
<p>It sounds awesome, that's it :P</p>



<a name="169296299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296299">(Jun 29 2019 at 12:56)</a>:</h4>
<p>Well, i work at CMS (one of the LHC experiments). My job is to check all the nodes in the grid and report any problems that might come up</p>



<a name="169296350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296350">(Jun 29 2019 at 12:58)</a>:</h4>
<p>So if for example if the cluster that KIT has connected to the grid stops accepting job submissions I should check why, try to solve it from here and if it is a local problem, write to their sysadmin so they can fix it</p>



<a name="169296418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296418">(Jun 29 2019 at 13:00)</a>:</h4>
<p>I've seen the Atlas detector in Real Life but not CMS unfortunately^^</p>



<a name="169296431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296431">(Jun 29 2019 at 13:01)</a>:</h4>
<p>cool stuff :)</p>



<a name="169296436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296436">(Jun 29 2019 at 13:01)</a>:</h4>
<p>Oh the competition &gt;:P</p>



<a name="169296487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296487">(Jun 29 2019 at 13:02)</a>:</h4>
<p>I have a gift for you: <a href="https://github.com/rust-lang/rust/pull/62229" target="_blank" title="https://github.com/rust-lang/rust/pull/62229">https://github.com/rust-lang/rust/pull/62229</a></p>



<a name="169296571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296571">(Jun 29 2019 at 13:05)</a>:</h4>
<p>just saw it. ;)</p>



<a name="169296829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296829">(Jun 29 2019 at 13:12)</a>:</h4>
<p>I'll wait for your comments and then rebase it</p>



<a name="169296965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296965">(Jun 29 2019 at 13:17)</a>:</h4>
<p>No need to rebase if it doesnt conflict</p>



<a name="169296986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169296986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169296986">(Jun 29 2019 at 13:18)</a>:</h4>
<p>in the mean time, I gave you something to do at <a href="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578" target="_blank" title="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578">https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578</a> :)</p>



<a name="169297077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169297077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169297077">(Jun 29 2019 at 13:21)</a>:</h4>
<blockquote>
<p>No need to rebase if it doesnt conflict</p>
</blockquote>
<p>But I need to hide my embarassing intermediate commits</p>



<a name="169297081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169297081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169297081">(Jun 29 2019 at 13:21)</a>:</h4>
<blockquote>
<p>in the mean time, I gave you something to do at <a href="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578" target="_blank" title="https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578">https://github.com/rust-lang/rust/pull/62158#issuecomment-506942578</a> :)</p>
</blockquote>
<p>Ok done it, should I force push this?</p>



<a name="169299292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299292">(Jun 29 2019 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> please do :)</p>



<a name="169299316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299316">(Jun 29 2019 at 14:22)</a>:</h4>
<p>Es ist fertig :P</p>



<a name="169299354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299354">(Jun 29 2019 at 14:23)</a>:</h4>
<p>where's the miri submodule update?</p>



<a name="169299356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299356">(Jun 29 2019 at 14:23)</a>:</h4>
<p>seems you skipped that part? :D</p>



<a name="169299358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299358">(Jun 29 2019 at 14:23)</a>:</h4>
<p>no way Jose</p>



<a name="169299361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299361">(Jun 29 2019 at 14:23)</a>:</h4>
<p>I did it, but the Cargo.lock did not change</p>



<a name="169299365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299365">(Jun 29 2019 at 14:23)</a>:</h4>
<p>thats cool</p>



<a name="169299367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299367">(Jun 29 2019 at 14:23)</a>:</h4>
<p>but then you didnt commit</p>



<a name="169299370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299370">(Jun 29 2019 at 14:23)</a>:</h4>
<p>or didnt push</p>



<a name="169299371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299371">(Jun 29 2019 at 14:23)</a>:</h4>
<p>i did</p>



<a name="169299378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299378">(Jun 29 2019 at 14:23)</a>:</h4>
<p>/me searches his shell history</p>



<a name="169299380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299380">(Jun 29 2019 at 14:24)</a>:</h4>
<p>look at <a href="https://github.com/rust-lang/rust/pull/62158/commits" target="_blank" title="https://github.com/rust-lang/rust/pull/62158/commits">https://github.com/rust-lang/rust/pull/62158/commits</a>. you didnt. ;)</p>



<a name="169299427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299427">(Jun 29 2019 at 14:24)</a>:</h4>
<p>Well IDK but <code>nothing to commit, working tree clean
</code></p>



<a name="169299450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299450">(Jun 29 2019 at 14:25)</a>:</h4>
<p>oh dang sorry that's my fault... stupid <code>x.py</code> automatism that I turned off long ago and forgot about</p>



<a name="169299454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299454">(Jun 29 2019 at 14:25)</a>:</h4>
<p>wait</p>



<a name="169299457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299457">(Jun 29 2019 at 14:25)</a>:</h4>
<p>second part</p>



<a name="169299458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299458">(Jun 29 2019 at 14:25)</a>:</h4>
<p>try again but without <code>x.py</code></p>
<div class="codehilite"><pre><span></span>cd src/tools/miri
git fetch origin
git reset --hard origin/rustup
cd ../../..
git commit -am &quot;update miri&quot;
</pre></div>



<a name="169299464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299464">(Jun 29 2019 at 14:25)</a>:</h4>
<p>I'm working from my fork</p>



<a name="169299507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299507">(Jun 29 2019 at 14:26)</a>:</h4>
<p>so <code>origin</code> is pointing to <code>christianpoveda/rust</code></p>



<a name="169299513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299513">(Jun 29 2019 at 14:26)</a>:</h4>
<p>and <em>then</em> do <code>./x.py</code> and see if it changes anythng (<code>git status</code>) and if it did add that to the commit (<code>git commit -a --amend</code>)</p>



<a name="169299515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299515">(Jun 29 2019 at 14:26)</a>:</h4>
<p>should i use the remote pointing to <code>rust-lang/rust</code>?</p>



<a name="169299520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299520">(Jun 29 2019 at 14:26)</a>:</h4>
<p>wait what? <code>origin</code> <em>in <code>src/tools/miri</code></em>?!?</p>



<a name="169299526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299526">(Jun 29 2019 at 14:26)</a>:</h4>
<blockquote>
<p>wait what? <code>origin</code> <em>in <code>src/tools/miri</code></em>?!?</p>
</blockquote>
<p>Loading</p>



<a name="169299527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299527">(Jun 29 2019 at 14:26)</a>:</h4>
<p>but why?^^</p>



<a name="169299528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299528">(Jun 29 2019 at 14:26)</a>:</h4>
<p>Ohhh</p>



<a name="169299538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299538">(Jun 29 2019 at 14:27)</a>:</h4>
<p>nevermind I forgot that's another repo</p>



<a name="169299539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299539">(Jun 29 2019 at 14:27)</a>:</h4>
<p>good :)</p>



<a name="169299587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299587">(Jun 29 2019 at 14:28)</a>:</h4>
<p>tada</p>



<a name="169299596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299596">(Jun 29 2019 at 14:28)</a>:</h4>
<p>it worked</p>



<a name="169299602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299602">(Jun 29 2019 at 14:28)</a>:</h4>
<p>there are conflicts in the PR though</p>



<a name="169299604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299604">(Jun 29 2019 at 14:28)</a>:</h4>
<p>which means your rebase didnt do what you should</p>



<a name="169299608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299608">(Jun 29 2019 at 14:28)</a>:</h4>
<p>did you make you you rebased onto the lastest upstream master?</p>



<a name="169299611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299611">(Jun 29 2019 at 14:28)</a>:</h4>
<p>let me redo it</p>



<a name="169299616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299616">(Jun 29 2019 at 14:29)</a>:</h4>
<p>your git setup is weird^^ for me <code>origin</code> is <em>always</em> upstream</p>



<a name="169299621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299621">(Jun 29 2019 at 14:29)</a>:</h4>
<p>if thats not the case for you, I am afraid you'll have to figure things out on your own...</p>



<a name="169299625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299625">(Jun 29 2019 at 14:29)</a>:</h4>
<p>yeah I know how to fix it</p>



<a name="169299626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299626">(Jun 29 2019 at 14:29)</a>:</h4>
<p>gimme a second</p>



<a name="169299679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299679">(Jun 29 2019 at 14:30)</a>:</h4>
<p>when I have a fork I usually do</p>
<div class="codehilite"><pre><span></span>git clone https://github.com/rust-lang/rust.git
cd rust
git remote add ralf git@github.com:RalfJung/rust.git
</pre></div>


<p>and that way <code>origin</code> is upstream and <code>ralf</code> is my fork</p>



<a name="169299691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299691">(Jun 29 2019 at 14:30)</a>:</h4>
<p>I do <code>origin -&gt; me</code>, <code>upstream -&gt; rust-lang</code></p>



<a name="169299693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299693">(Jun 29 2019 at 14:30)</a>:</h4>
<p>ok now it should work</p>



<a name="169299777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299777">(Jun 29 2019 at 14:33)</a>:</h4>
<blockquote>
<p>I do <code>origin -&gt; me</code>, <code>upstream -&gt; rust-lang</code></p>
</blockquote>
<p>fair</p>



<a name="169299781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299781">(Jun 29 2019 at 14:33)</a>:</h4>
<p>I'llt ry to remember that for my future instructions :D</p>



<a name="169299793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299793">(Jun 29 2019 at 14:33)</a>:</h4>
<p>hm now there are two "update miri" commits?^^</p>



<a name="169299833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299833">(Jun 29 2019 at 14:34)</a>:</h4>
<p>ah no taht was GH being silly</p>



<a name="169299837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299837">(Jun 29 2019 at 14:34)</a>:</h4>
<p>because the night is dark and full of terrors</p>



<a name="169299838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299838">(Jun 29 2019 at 14:34)</a>:</h4>
<p>oh no</p>



<a name="169299839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299839">(Jun 29 2019 at 14:34)</a>:</h4>
<p>they were, i just squashed :P</p>



<a name="169299841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299841">(Jun 29 2019 at 14:34)</a>:</h4>
<p>something went very wrong</p>



<a name="169299842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299842">(Jun 29 2019 at 14:34)</a>:</h4>
<p>refresh</p>



<a name="169299845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299845">(Jun 29 2019 at 14:34)</a>:</h4>
<p>look at this: <a href="https://github.com/rust-lang/rust/pull/62158/commits/47f80aed9d7854699a1bd1151f0cdad4667533a9" target="_blank" title="https://github.com/rust-lang/rust/pull/62158/commits/47f80aed9d7854699a1bd1151f0cdad4667533a9">https://github.com/rust-lang/rust/pull/62158/commits/47f80aed9d7854699a1bd1151f0cdad4667533a9</a></p>



<a name="169299848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299848">(Jun 29 2019 at 14:34)</a>:</h4>
<p>you updated 7 submodules or so</p>



<a name="169299850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299850">(Jun 29 2019 at 14:34)</a>:</h4>
<p>submodules are awful :/</p>



<a name="169299852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299852">(Jun 29 2019 at 14:34)</a>:</h4>
<p>/me cries in spanish</p>



<a name="169299854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299854">(Jun 29 2019 at 14:34)</a>:</h4>
<p>so let's try that again</p>



<a name="169299857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299857">(Jun 29 2019 at 14:34)</a>:</h4>
<p>let me delete the commit and do it again</p>



<a name="169299861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299861">(Jun 29 2019 at 14:35)</a>:</h4>
<p>step 1: cleanup. <code>git reset --hard HEAD^</code></p>



<a name="169299862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299862">(Jun 29 2019 at 14:35)</a>:</h4>
<p>yes</p>



<a name="169299866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299866">(Jun 29 2019 at 14:35)</a>:</h4>
<p>now, next thing, get submodules clean</p>



<a name="169299869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299869">(Jun 29 2019 at 14:35)</a>:</h4>
<p>I have a <code>git subfix</code> command for that</p>



<a name="169299874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299874">(Jun 29 2019 at 14:35)</a>:</h4>
<p>that's <code>git submodule update --init --recursive</code></p>



<a name="169299878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299878">(Jun 29 2019 at 14:35)</a>:</h4>
<p>you can also do <code>./x.py</code>, it does that per default (which is why it killed your miri update the last time)</p>



<a name="169299923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299923">(Jun 29 2019 at 14:36)</a>:</h4>
<p>after that, <code>git diff</code> should be clean</p>



<a name="169299926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299926">(Jun 29 2019 at 14:36)</a>:</h4>
<p>it is</p>



<a name="169299928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299928">(Jun 29 2019 at 14:36)</a>:</h4>
<p><em>always</em> do <code>git diff</code> right before <code>git commit</code> to know what you are committing! that would have prevented this mistake</p>



<a name="169299931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299931">(Jun 29 2019 at 14:36)</a>:</h4>
<p>now do the <code>cd src/tools/miri</code> etc part</p>



<a name="169299949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169299949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169299949">(Jun 29 2019 at 14:37)</a>:</h4>
<p>It worked</p>



<a name="169300006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300006">(Jun 29 2019 at 14:39)</a>:</h4>
<p>yay, it did :D</p>



<a name="169300009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300009">(Jun 29 2019 at 14:39)</a>:</h4>
<p>congrats on your first miri submodule update :D</p>



<a name="169300092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300092">(Jun 29 2019 at 14:41)</a>:</h4>
<p>/me smiles</p>



<a name="169300701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300701">(Jun 29 2019 at 14:56)</a>:</h4>
<p>It's 7 24</p>



<a name="169300702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300702">(Jun 29 2019 at 14:56)</a>:</h4>
<p>Ill get out of bed at 7 30</p>



<a name="169300704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300704">(Jun 29 2019 at 14:56)</a>:</h4>
<p>lol</p>



<a name="169300712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300712">(Jun 29 2019 at 14:57)</a>:</h4>
<p>Ohh nice the zulip app finally worked</p>



<a name="169300832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169300832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169300832">(Jun 29 2019 at 15:00)</a>:</h4>
<p>twice</p>



<a name="169301063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301063">(Jun 29 2019 at 15:06)</a>:</h4>
<p>Do you think that using  intptrcast during casting needs some tests?</p>



<a name="169301218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301218">(Jun 29 2019 at 15:11)</a>:</h4>
<p>on the Miri side? yes!</p>



<a name="169301226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301226">(Jun 29 2019 at 15:11)</a>:</h4>
<p><code>&amp;42 as usize as u8</code></p>



<a name="169301269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301269">(Jun 29 2019 at 15:12)</a>:</h4>
<p>Oh the famous one</p>



<a name="169301275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301275">(Jun 29 2019 at 15:12)</a>:</h4>
<p>and then something that transmutes...</p>
<div class="codehilite"><pre><span></span>fn transmute_ptr_to_int&lt;T&gt;(x: *const T) -&gt; usize { mem::transmute(x) }

transmute_ptr_to_int(&amp;42) as u8
</pre></div>



<a name="169301277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301277">(Jun 29 2019 at 15:12)</a>:</h4>
<p>that's a slightly different code path</p>



<a name="169301281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301281">(Jun 29 2019 at 15:13)</a>:</h4>
<p>you can then even compare you get the same result both ways :D</p>



<a name="169301288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301288">(Jun 29 2019 at 15:13)</a>:</h4>
<p>Should I reuse the same <code>intptrcast.rs</code> test file?</p>



<a name="169301290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169301290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169301290">(Jun 29 2019 at 15:13)</a>:</h4>
<p>yes please</p>



<a name="169303584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169303584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169303584">(Jun 29 2019 at 16:25)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0606]: casting `&amp;i32` as `usize` is invalid
  --&gt; $DIR/intptrcast.rs:14:13
   |
14 |     let b = &amp;42 as usize as u8;
   |             ---^^^^^^^^^
   |             |
   |             cannot cast `&amp;i32` as `usize`
   |             help: dereference the expression: `*&amp;42`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0606`.
</pre></div>



<a name="169304256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304256">(Jun 29 2019 at 16:47)</a>:</h4>
<p>yeah I forgot the intermediate raw pointer</p>



<a name="169304258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304258">(Jun 29 2019 at 16:47)</a>:</h4>
<p>just adjust it to make it work ;)</p>



<a name="169304298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304298">(Jun 29 2019 at 16:48)</a>:</h4>
<p>it does not work either</p>



<a name="169304302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304302">(Jun 29 2019 at 16:48)</a>:</h4>
<p>which error?</p>



<a name="169304310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304310">(Jun 29 2019 at 16:49)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0080]: Miri evaluation error: a raw memory access tried to access part of a pointer value as raw bytes
  --&gt; $DIR/intptrcast.rs:14:13
   |
14 |     let b = &amp;42 as *const i32 as usize as u8;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri evaluation error: a raw memory access tried to access part of a pointer value as raw bytes
   |
   = note: inside call to `main` at /home/christian/Workspace/contrib/rust/src/libstd/rt.rs:64:34
   = note: inside call to closure at /home/christian/Workspace/contrib/rust/src/libstd/rt.rs:49:73
   = note: inside call to closure at /home/christian/Workspace/contrib/rust/src/libstd/sys_common/backtrace.rs:77:5
   = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::&lt;[closure@DefId(1:5944 ~ std[9246]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&amp;dyn std::ops::Fn() -&gt; i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32&gt;` at /home/christian/Workspace/contrib/rust/src/libstd/rt.rs:49:13
   = note: inside call to closure at /home/christian/Workspace/contrib/rust/src/libstd/panicking.rs:294:40
   = note: inside call to `std::panicking::try::do_call::&lt;[closure@DefId(1:5943 ~ std[9246]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&amp;&amp;dyn std::ops::Fn() -&gt; i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32&gt;` at /home/christian/Workspace/contrib/rust/src/libstd/panicking.rs:290:5
   = note: inside call to `std::panicking::try::&lt;i32, [closure@DefId(1:5943 ~ std[9246]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&amp;&amp;dyn std::ops::Fn() -&gt; i32 + std::marker::Sync + std::panic::RefUnwindSafe]&gt;` at /home/christian/Workspace/contrib/rust/src/libstd/panic.rs:388:9
   = note: inside call to `std::panic::catch_unwind::&lt;[closure@DefId(1:5943 ~ std[9246]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&amp;&amp;dyn std::ops::Fn() -&gt; i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32&gt;` at /home/christian/Workspace/contrib/rust/src/libstd/rt.rs:48:25
   = note: inside call to `std::rt::lang_start_internal` at /home/christian/Workspace/contrib/rust/src/libstd/rt.rs:64:5
   = note: inside call to `std::rt::lang_start::&lt;()&gt;`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
</pre></div>



<a name="169304358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304358">(Jun 29 2019 at 16:50)</a>:</h4>
<p>does adding <code>-Zmiri-disable-validation</code> to the flags help?</p>



<a name="169304361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304361">(Jun 29 2019 at 16:50)</a>:</h4>
<p>Im a complete idiot</p>



<a name="169304363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304363">(Jun 29 2019 at 16:50)</a>:</h4>
<p>Oh wait, having the flag in the file enables it?</p>



<a name="169304364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304364">(Jun 29 2019 at 16:50)</a>:</h4>
<p>of course it does nvm</p>



<a name="169304365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304365">(Jun 29 2019 at 16:50)</a>:</h4>
<p>let me disable validation</p>



<a name="169304366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304366">(Jun 29 2019 at 16:50)</a>:</h4>
<p>only when you run it in the test suite</p>



<a name="169304373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304373">(Jun 29 2019 at 16:51)</a>:</h4>
<p>or just do <code>./miri run tests/run-pass/intptrcast -Zmiri-seed=42 -Zmiri-disable-validation</code></p>



<a name="169304377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304377">(Jun 29 2019 at 16:51)</a>:</h4>
<p>that's probably easier anyway while you are still debugging, to run the test directly</p>



<a name="169304379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304379">(Jun 29 2019 at 16:51)</a>:</h4>
<p>same error</p>



<a name="169304421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304421">(Jun 29 2019 at 16:52)</a>:</h4>
<p>then it looks like your patch doesn't do what it should</p>



<a name="169304426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304426">(Jun 29 2019 at 16:52)</a>:</h4>
<p>oh well...</p>



<a name="169304439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304439">(Jun 29 2019 at 16:52)</a>:</h4>
<p>(I didnt look at it yet.)</p>



<a name="169304532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304532">(Jun 29 2019 at 16:55)</a>:</h4>
<p>probably <code>force_bits</code> always fails and it's just executing the old behaviour</p>



<a name="169304720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304720">(Jun 29 2019 at 17:00)</a>:</h4>
<p>well you need to set <code>-Zmiri-seed</code> to make that not fail</p>



<a name="169304748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304748">(Jun 29 2019 at 17:00)</a>:</h4>
<p>but you can check that easily by making this not the <em>first</em> thing that intrptrcast tests</p>



<a name="169304751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304751">(Jun 29 2019 at 17:00)</a>:</h4>
<p>so you can tell if your prior tests still pass</p>



<a name="169304759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304759">(Jun 29 2019 at 17:00)</a>:</h4>
<p>well thats the thing</p>



<a name="169304777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304777">(Jun 29 2019 at 17:01)</a>:</h4>
<p>all the intptrcasts tests pass, including the <code>intptrcast.rs</code> original test</p>



<a name="169304782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304782">(Jun 29 2019 at 17:01)</a>:</h4>
<p>so, it is enabled</p>



<a name="169304787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304787">(Jun 29 2019 at 17:01)</a>:</h4>
<p>how exactly are you running the test?</p>



<a name="169304826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304826">(Jun 29 2019 at 17:02)</a>:</h4>
<p>./miri test intptrcast</p>



<a name="169304895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304895">(Jun 29 2019 at 17:04)</a>:</h4>
<p>that will take the flag into account, yeah</p>



<a name="169304897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304897">(Jun 29 2019 at 17:04)</a>:</h4>
<p>I usually prefer to test via <code>./miri run</code> when working on a particular test case</p>



<a name="169304918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304918">(Jun 29 2019 at 17:04)</a>:</h4>
<p>avoids all the compiletest junk around it</p>



<a name="169304920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304920">(Jun 29 2019 at 17:04)</a>:</h4>
<p>but then you need to remember to pass the flags</p>



<a name="169304929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304929">(Jun 29 2019 at 17:05)</a>:</h4>
<p>either way, let's see where the error comes from: do <code>MIRI_BACKTRACE=1 ./miri ...</code></p>



<a name="169304995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169304995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169304995">(Jun 29 2019 at 17:07)</a>:</h4>
<div class="codehilite"><pre><span></span>stack backtrace:
   0: &lt;rustc::mir::interpret::error::InterpErrorInfo as core::convert::From&lt;rustc::mir::interpret::error::InterpError&lt;u64&gt;&gt;&gt;::from::h82824632c52c5588 (0x7f7418faf77d)
   1: &lt;T as core::convert::Into&lt;U&gt;&gt;::into::h20a9a7d5cf115f97 (0x55a20c2a306c)
             at /home/christian/Workspace/contrib/rust/src/libcore/convert.rs:540
      rustc_mir::interpret::cast::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::cast_from_ptr::hfcd977be000db5ce
             at /home/christian/Workspace/contrib/miri/&lt;::rustc::mir::interpret::err macros&gt;:2
      rustc_mir::interpret::cast::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::cast_scalar::h670bd5c154169f8c
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/cast.rs:154
      rustc_mir::interpret::cast::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::cast::h557da123a3f5f2b8
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/cast.rs:71
      rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::eval_rvalue_into_place::h9a9fd2a982f648ae
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:264
   2: rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::statement::h850ab37b10a6d2a9 (0x55a20c2a7b1f)
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:85
      rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::step::ha5c6b83338e2c707
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:61
      rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::run::h57378d0f609d97a3
             at /home/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:40
   3: miri::eval_main::{{closure}}::h89905980517900df (0x55a20c1f0c10)
             at src/lib.rs:233
      miri::eval_main::h552c5f486ccc6954
             at src/lib.rs:232
   4: &lt;miri::MiriCompilerCalls as rustc_driver::Callbacks&gt;::after_analysis::{{closure}}::h3d330d8e2971815c (0x55a20c1dc85d)
             at src/bin/miri.rs:50
      rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}::{{closure}}::h6f9191972b894d3d
             at /home/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
      rustc::ty::context::tls::enter_global::{{closure}}::hfd01637ff81ead61
             at /home/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1963
      rustc::ty::context::tls::enter_context::{{closure}}::hd577f6dac22a3083
             at /home/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1929
      rustc::ty::context::tls::set_tlv::h5a7b061128e7af69
             at /home/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1862
      rustc::ty::context::tls::enter_context::h0b2e865728aa47f6
             at /home/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1928
      rustc::ty::context::tls::enter_global::h467844306770a71d
             at /home/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1962
      rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}::h2960106158652d01
             at /home/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
      rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::h8c4d575a5dad4633
             at /home/christian/Workspace/contrib/miri/&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:17
   5: rustc_interface::passes::create_global_ctxt::{{closure}}::h3ff26032759f5a9e (0x7f7419b6f02a)
   6: alloc::boxed::&lt;impl core::ops::generator::Generator for core::pin::Pin&lt;alloc::boxed::Box&lt;G&gt;&gt;&gt;::resume::hd76abb37f74b0a9c (0x55a20c1d4dd8)
             at /home/christian/Workspace/contrib/rust/src/liballoc/boxed.rs:897
      rustc_data_structures::box_region::PinnedGenerator&lt;I,A,R&gt;::access::hbeeff207cbbdc75b
             at /home/christian/Workspace/contrib/rust/src/librustc_data_structures/box_region.rs:52
      rustc_interface::passes::BoxedGlobalCtxt::access::h9b1575dd5e5b40d6
             at /home/christian/Workspace/contrib/miri/&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:19
      rustc_interface::passes::BoxedGlobalCtxt::enter::h7a7f03749629a8b5
             at /home/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
      &lt;miri::MiriCompilerCalls as rustc_driver::Callbacks&gt;::after_analysis::hb6707e96b5844de3
             at src/bin/miri.rs:43
   7: rustc_interface::interface::run_compiler_in_existing_thread_pool::h6e338a04d6764d6d (0x7f7419d2f7ce)
   8: std::thread::local::LocalKey&lt;T&gt;::with::h4a03cecefd8dd030 (0x7f7419d37222)
   9: scoped_tls::ScopedKey&lt;T&gt;::set::h549ab693e1140564 (0x7f7419d3cab1)
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::hb167da37f98141ab (0x7f7419d66428)
  11: __rust_maybe_catch_panic (0x7f7418384dfa)
  12: core::ops::function::FnOnce::call_once{{vtable.shim}}::h4d9f25aca7afcc7b (0x7f7419d31a99)
  13: &lt;alloc::boxed::Box&lt;F&gt; as core::ops::function::FnOnce&lt;A&gt;&gt;::call_once::hb025baad84174e4e (0x7f741837088f)
  14: std::sys_common::thread::start_thread::h31fed19fe88dea46 (0x7f741834e9a0)
  15: std::sys::unix::thread::Thread::new::thread_start::h1d763bf49ef30be4 (0x7f741837bd76)
  16: start_thread (0x7f74182c157f)
  17: __clone (0x7f74181d70e3)
  18: &lt;unknown&gt; (0x0)
</pre></div>



<a name="169305058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305058">(Jun 29 2019 at 17:09)</a>:</h4>
<p>so <code>cast_from_ptr</code>, right?</p>



<a name="169305118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305118">(Jun 29 2019 at 17:10)</a>:</h4>
<p>How can we be sure that the error came from the actual <code>err!(..)</code> inside it and not from <code>force_ptr</code>?</p>



<a name="169305141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305141">(Jun 29 2019 at 17:11)</a>:</h4>
<p>oh</p>



<a name="169305142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305142">(Jun 29 2019 at 17:11)</a>:</h4>
<p>forget it</p>



<a name="169305145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305145">(Jun 29 2019 at 17:12)</a>:</h4>
<p>it's my fault I'm on the "initialize ecx with 'MemoryExtra'" branch</p>



<a name="169305184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305184">(Jun 29 2019 at 17:12)</a>:</h4>
<p>plop!</p>



<a name="169305185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305185">(Jun 29 2019 at 17:12)</a>:</h4>
<p>aha ;)</p>



<a name="169305189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305189">(Jun 29 2019 at 17:12)</a>:</h4>
<p>Hahahaha, I should have a "jackass" version for compile coding</p>



<a name="169305191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305191">(Jun 29 2019 at 17:12)</a>:</h4>
<blockquote>
<p>How can we be sure that the error came from the actual <code>err!(..)</code> inside it and not from <code>force_ptr</code>?</p>
</blockquote>
<p>check the line numbers</p>



<a name="169305201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305201">(Jun 29 2019 at 17:13)</a>:</h4>
<p>ok</p>



<a name="169305202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305202">(Jun 29 2019 at 17:13)</a>:</h4>
<p>will recompile and see whats up</p>



<a name="169305254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305254">(Jun 29 2019 at 17:14)</a>:</h4>
<blockquote>
<p>Hahahaha, I should have a "jackass" version for compile coding</p>
</blockquote>
<p>Hello! I'm Christian and this is Jackass! On today's episode we'll se how to test a feature that is not implemented in the branch you're in</p>



<a name="169305419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305419">(Jun 29 2019 at 17:18)</a>:</h4>
<p>as someone not watching much TV while growing up (is that a TV thing?)... this went over my head^^</p>



<a name="169305420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305420">(Jun 29 2019 at 17:18)</a>:</h4>
<p>you can apply my review feedback while you are at it ;)</p>



<a name="169305421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305421">(Jun 29 2019 at 17:18)</a>:</h4>
<p>but I can guess some of it from context :D</p>



<a name="169305486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305486">(Jun 29 2019 at 17:21)</a>:</h4>
<p>I was not a TV kid either</p>



<a name="169305487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305487">(Jun 29 2019 at 17:21)</a>:</h4>
<p>but all my school buddies did watch it so I watch an episode or two. The show is a bunch of stupid guys doing crazy and dangerous stunts</p>



<a name="169305490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305490">(Jun 29 2019 at 17:21)</a>:</h4>
<blockquote>
<p>you can apply my review feedback while you are at it ;)</p>
</blockquote>
<p>I already did! In fact, I realized because I was going to do the change and then didn't found my code in the file...</p>



<a name="169305536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169305536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169305536">(Jun 29 2019 at 17:22)</a>:</h4>
<p>^^</p>



<a name="169307004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307004">(Jun 29 2019 at 18:12)</a>:</h4>
<p>It worked</p>



<a name="169307005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307005">(Jun 29 2019 at 18:12)</a>:</h4>
<p>/me dances</p>



<a name="169307114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307114">(Jun 29 2019 at 18:16)</a>:</h4>
<p>I'm going to do a PR in miri with the new test</p>



<a name="169307189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307189">(Jun 29 2019 at 18:19)</a>:</h4>
<p>awesome!</p>



<a name="169307192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307192">(Jun 29 2019 at 18:19)</a>:</h4>
<p>just pushed the changes to the rustc PR branch</p>



<a name="169307356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169307356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169307356">(Jun 29 2019 at 18:24)</a>:</h4>
<p>just r+'ed them :)</p>



<a name="169333125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169333125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169333125">(Jun 30 2019 at 09:44)</a>:</h4>
<p>Hallo!</p>



<a name="169333236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169333236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169333236">(Jun 30 2019 at 09:48)</a>:</h4>
<p>I removed the trailing whitespaces</p>



<a name="169333243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169333243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169333243">(Jun 30 2019 at 09:48)</a>:</h4>
<p>I used to have that on my vim configuration but then I started using LSP for everything and I ended up removing the plugin I used to fix that kind of stuff</p>



<a name="169333895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169333895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169333895">(Jun 30 2019 at 10:10)</a>:</h4>
<p><a href="https://github.com/christianpoveda/dotfiles/commit/643eb93f372d7d941d51f73f308a70aa7cd6e49e" target="_blank" title="https://github.com/christianpoveda/dotfiles/commit/643eb93f372d7d941d51f73f308a70aa7cd6e49e">https://github.com/christianpoveda/dotfiles/commit/643eb93f372d7d941d51f73f308a70aa7cd6e49e</a> :P</p>



<a name="169342559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342559">(Jun 30 2019 at 14:48)</a>:</h4>
<p>@RalfJ should I continue with the next item in the intptrcast issue?</p>



<a name="169342886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342886">(Jun 30 2019 at 14:59)</a>:</h4>
<p>sure :D</p>



<a name="169342890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342890">(Jun 30 2019 at 14:59)</a>:</h4>
<p>"partial reads from pointers" is an interesting one, you'll see some new parts of rustc</p>



<a name="169342896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342896">(Jun 30 2019 at 15:00)</a>:</h4>
<p>however I dont have that much time for mentoring until July 11th... :/</p>



<a name="169342934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342934">(Jun 30 2019 at 15:00)</a>:</h4>
<p>also have you seen <a href="https://github.com/rust-lang/miri/pull/809" target="_blank" title="https://github.com/rust-lang/miri/pull/809">https://github.com/rust-lang/miri/pull/809</a> ? :D</p>



<a name="169342946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342946">(Jun 30 2019 at 15:00)</a>:</h4>
<p>let's see if that works...</p>



<a name="169342952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169342952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169342952">(Jun 30 2019 at 15:00)</a>:</h4>
<p>it actually might not because of my strict(er) alignment checks. well we'll see.</p>



<a name="169344145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344145">(Jun 30 2019 at 15:36)</a>:</h4>
<blockquote>
<p>also have you seen <a href="https://github.com/rust-lang/miri/pull/809" target="_blank" title="https://github.com/rust-lang/miri/pull/809">https://github.com/rust-lang/miri/pull/809</a> ? :D</p>
</blockquote>
<p>Ohh fancy</p>



<a name="169344153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344153">(Jun 30 2019 at 15:37)</a>:</h4>
<blockquote>
<p>however I dont have that much time for mentoring until July 11th... :/</p>
</blockquote>
<p>That would be a nice exercise for my independence :P</p>



<a name="169344211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344211">(Jun 30 2019 at 15:39)</a>:</h4>
<blockquote>
<p>"partial reads from pointers" is an interesting one, you'll see some new parts of rustc</p>
</blockquote>
<p>What does "partial" means in this context?</p>



<a name="169344214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344214">(Jun 30 2019 at 15:39)</a>:</h4>
<p>here's a piece of code for you, a test case for "partially loading a pointer":</p>
<div class="codehilite"><pre><span></span>let some_ptr = &amp;42;
let ptr_to_ptr = &amp;some_ptr as *const _ as *const u8;
let _val = *ptr_to_ptr;
</pre></div>


<p>this will currently fail to execute I think, even with all your stuff landed. it should work though.<br>
this is "easy mode", once that works you can come back and ask for "hard mode". ;)</p>
<p>the key method that needs changing is <code>read_scalar</code> at <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L313" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L313">https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L313</a>.</p>



<a name="169344261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344261">(Jun 30 2019 at 15:40)</a>:</h4>
<p>what makes that test case nasty is that we are reading just one byte from a pointer... combined with how we store pointers in memory, that's a nasty special case.</p>



<a name="169344265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344265">(Jun 30 2019 at 15:40)</a>:</h4>
<p>in particular you can see the special case for <code>size == cx.data_layout().pointer_size</code> in the code I linked</p>



<a name="169344278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344278">(Jun 30 2019 at 15:41)</a>:</h4>
<p>Ohh so you have a pointer to N bytes and you cast to a pointer to M bytes with M &lt; N and then dereference it</p>



<a name="169344672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344672">(Jun 30 2019 at 15:53)</a>:</h4>
<p>the key part is that it's a pointer <em>to a pointer</em></p>



<a name="169344675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344675">(Jun 30 2019 at 15:53)</a>:</h4>
<p>that you cast to a pointer to <code>u8</code></p>



<a name="169344679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344679">(Jun 30 2019 at 15:53)</a>:</h4>
<p>and then dereferencing it reads only the first byte of the pointer that the pointer points to</p>



<a name="169344682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344682">(Jun 30 2019 at 15:53)</a>:</h4>
<p>so that should be <code>force_bits</code> and then <code>force_ptr</code> I suppose?</p>



<a name="169344725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344725">(Jun 30 2019 at 15:54)</a>:</h4>
<p>well the first thing is, how are pointers even stored in memory in Miri</p>



<a name="169344729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344729">(Jun 30 2019 at 15:54)</a>:</h4>
<p>take a look at <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L17" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L17">https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L17</a></p>



<a name="169344732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344732">(Jun 30 2019 at 15:54)</a>:</h4>
<p>you can see that we store a bunch of <code>u8</code> in <code>bytes</code></p>



<a name="169344739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344739">(Jun 30 2019 at 15:55)</a>:</h4>
<p>yes</p>



<a name="169344744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344744">(Jun 30 2019 at 15:55)</a>:</h4>
<p>but a <code>Pointer</code> consists of an <code>offset</code> and an <code>alloc_id</code> and more, that's at least 16 bytes of data and yet it only takes up 8 bytes of space (assuming 64bit)</p>



<a name="169344785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344785">(Jun 30 2019 at 15:56)</a>:</h4>
<p>so, where's the rest of the information of the Pointer?</p>



<a name="169344843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344843">(Jun 30 2019 at 15:58)</a>:</h4>
<p>or what is your point?</p>



<a name="169344850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344850">(Jun 30 2019 at 15:58)</a>:</h4>
<p>the rest is in the <code>relocations</code></p>



<a name="169344866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344866">(Jun 30 2019 at 15:59)</a>:</h4>
<p>so say we have an allocation (of size 8) that stores a pointer</p>



<a name="169344942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344942">(Jun 30 2019 at 16:01)</a>:</h4>
<p>that allocation is going to look as follows:<br>
<code>bytes</code>, has size 8, stores the <code>offset</code> part of the pointer (using the target's endianess)<br>
<code>relocations</code> (the type is <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L541" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L541">defined here</a>) is basically a hash map, and it stores <code>0: (alloc_id, tag)</code></p>



<a name="169344945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169344945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169344945">(Jun 30 2019 at 16:01)</a>:</h4>
<p>this thing in relocations means "at offset 0, we are storing a pointer; the next N bytes in <code>bytes</code> are the offset and here is the missing information"</p>



<a name="169345118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169345118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169345118">(Jun 30 2019 at 16:06)</a>:</h4>
<blockquote>
<p>the next N bytes in <code>bytes</code> are the offset and here is the missing information"</p>
</blockquote>
<p>that offset is the <code>offset</code> of the allocated pointer, right?</p>



<a name="169345453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169345453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169345453">(Jun 30 2019 at 16:17)</a>:</h4>
<p>they are the <code>offset</code> field of the <code>Pointer</code></p>



<a name="169345458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169345458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169345458">(Jun 30 2019 at 16:17)</a>:</h4>
<p>see <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.Pointer.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.Pointer.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.Pointer.html</a></p>



<a name="169345460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169345460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169345460">(Jun 30 2019 at 16:17)</a>:</h4>
<p>yep, that's what I meant :P</p>



<a name="169345502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169345502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169345502">(Jun 30 2019 at 16:18)</a>:</h4>
<p>And the AllocId and the Tag are the missing information that <code>relocations</code> stores in this particular case</p>



<a name="169346012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346012">(Jun 30 2019 at 16:36)</a>:</h4>
<p>yes</p>



<a name="169346013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346013">(Jun 30 2019 at 16:36)</a>:</h4>
<p>(there is no other case^^)</p>



<a name="169346023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346023">(Jun 30 2019 at 16:37)</a>:</h4>
<p>Ok</p>



<a name="169346024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346024">(Jun 30 2019 at 16:37)</a>:</h4>
<p>in general of course an allocation can store pointers and "raw" data, so an allocation of size 40 might have an entry like <code>8: (alloc_id, tag)</code> in the relocations, indicating that the bytes <code>8..16</code> are actually a pointer (and the remaining bytes are "normal" bytes)</p>



<a name="169346080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346080">(Jun 30 2019 at 16:38)</a>:</h4>
<blockquote>
<p>in general of course an allocation can store pointers and "raw" data, so an allocation of size 40 might have an entry like <code>8: (alloc_id, tag)</code> in the relocations, indicating that the bytes <code>8..16</code> are actually a pointer (and the remaining bytes are "normal" bytes)</p>
</blockquote>
<p>yeah that's what I thought when I said "in this particular case"</p>



<a name="169346097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346097">(Jun 30 2019 at 16:39)</a>:</h4>
<p>okay :)</p>



<a name="169346274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346274">(Jun 30 2019 at 16:44)</a>:</h4>
<p>So, when we do the ptr to ptr cast, what happens with the pointer's allocation?</p>



<a name="169346552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346552">(Jun 30 2019 at 16:53)</a>:</h4>
<p>nothing</p>



<a name="169346555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346555">(Jun 30 2019 at 16:53)</a>:</h4>
<p>a ptr to ptr cast just changes the type, and leaves the value and everything else unchanged</p>



<a name="169346557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346557">(Jun 30 2019 at 16:53)</a>:</h4>
<p>it's a NOP, really</p>



<a name="169346599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346599">(Jun 30 2019 at 16:54)</a>:</h4>
<p>So when you try to derefernce you're still getting the same address at the end but you end up reading less bytes</p>



<a name="169346600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346600">(Jun 30 2019 at 16:54)</a>:</h4>
<p>yes</p>



<a name="169346671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169346671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169346671">(Jun 30 2019 at 16:57)</a>:</h4>
<p>and then, what is the real problem?</p>



<a name="169347001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347001">(Jun 30 2019 at 17:06)</a>:</h4>
<p>it means that when reading memory you cant just look at the <code>bytes</code>, you have to consider the <code>relocations</code> as well</p>



<a name="169347006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347006">(Jun 30 2019 at 17:06)</a>:</h4>
<p>and currently the only way we support to do that is when the read starts exactly where the relocation starts and has size 8</p>



<a name="169347007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347007">(Jun 30 2019 at 17:06)</a>:</h4>
<p>because then we can just make it a <code>Pointer</code></p>



<a name="169347015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347015">(Jun 30 2019 at 17:07)</a>:</h4>
<p>in any other case, you are reading one byte of the <em>offset</em> of the pointer, and that's the wrong thing to return, so we error instead</p>



<a name="169347321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347321">(Jun 30 2019 at 17:17)</a>:</h4>
<blockquote>
<p>and currently the only way we support to do that is when the read starts exactly where the relocation starts and has size 8</p>
</blockquote>
<p>this is what <code>read_scalar</code> does, right?</p>



<a name="169347368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347368">(Jun 30 2019 at 17:18)</a>:</h4>
<p>I assume that's what <code>check_relocations</code> used for</p>



<a name="169347437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347437">(Jun 30 2019 at 17:20)</a>:</h4>
<p>exactly</p>



<a name="169347559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347559">(Jun 30 2019 at 17:25)</a>:</h4>
<p>So let me see If i understand</p>



<a name="169347560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347560">(Jun 30 2019 at 17:25)</a>:</h4>
<p>if we try to do a partial read</p>



<a name="169347610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347610">(Jun 30 2019 at 17:26)</a>:</h4>
<p>The size of what we are reading will be different from the original size of the pointer, so when we <code>check_relocations</code>is going to fail because the pointer in fact has rellocations with its tag and allocation id</p>



<a name="169347729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169347729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169347729">(Jun 30 2019 at 17:30)</a>:</h4>
<p>I'm still confused with the sizes between the size of the pointers and the size of the pointees</p>



<a name="169418115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418115">(Jul 01 2019 at 18:15)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> , hey hi! I saw the perf regression when I changed mem_extra to mem in the tag methods, should I do the inlining change?</p>



<a name="169418316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418316">(Jul 01 2019 at 18:16)</a>:</h4>
<p>you can but it doesnt help</p>



<a name="169418321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418321">(Jul 01 2019 at 18:16)</a>:</h4>
<p>I already tried that in <a href="https://github.com/rust-lang/rust/pull/62264" target="_blank" title="https://github.com/rust-lang/rust/pull/62264">https://github.com/rust-lang/rust/pull/62264</a></p>



<a name="169418325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418325">(Jul 01 2019 at 18:16)</a>:</h4>
<p>Oh damn</p>



<a name="169418335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418335">(Jul 01 2019 at 18:16)</a>:</h4>
<p>What is the course of action there? revert the change?</p>



<a name="169418509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418509">(Jul 01 2019 at 18:19)</a>:</h4>
<p>I'm currently benchmarking that</p>



<a name="169418518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418518">(Jul 01 2019 at 18:19)</a>:</h4>
<p>because I cant really believe this caused a regression^^</p>



<a name="169418569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418569">(Jul 01 2019 at 18:20)</a>:</h4>
<p>hehehe</p>



<a name="169418581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418581">(Jul 01 2019 at 18:20)</a>:</h4>
<p>but if the revert confirms this (by being an improvement), I'll try only reverting the parts of the change that we did "for consistency"</p>



<a name="169418592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418592">(Jul 01 2019 at 18:20)</a>:</h4>
<p>yeah that would be the tag methods only</p>



<a name="169418594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418594">(Jul 01 2019 at 18:20)</a>:</h4>
<p>if that fixes the problem, good for us. though I'd also really like to understand <em>why</em>.</p>



<a name="169418599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418599">(Jul 01 2019 at 18:20)</a>:</h4>
<p>these perf things are the worst :/</p>



<a name="169418618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418618">(Jul 01 2019 at 18:21)</a>:</h4>
<p>I spent <em>so much</em> time debugging perf issues in PRs that really shouldnt have any, its no fun. and takes a <em>lot</em> of time. and I dont really know what I am doing.</p>



<a name="169418673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418673">(Jul 01 2019 at 18:21)</a>:</h4>
<p>I'm going to take some notes about the ptr to ptr cast to understand it better and I'll be back with questions</p>



<a name="169418796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418796">(Jul 01 2019 at 18:23)</a>:</h4>
<p>kk</p>



<a name="169418891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418891">(Jul 01 2019 at 18:24)</a>:</h4>
<p>you can also first do the "force_ptr when creating a non-ZST reference." thing if you want, that's easier. ;)</p>



<a name="169418957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169418957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169418957">(Jul 01 2019 at 18:25)</a>:</h4>
<p>Hehehe, no I want to tackle this. Thinking in a selfish way, my only benefit of this is learning how it works.</p>



<a name="169419100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169419100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169419100">(Jul 01 2019 at 18:26)</a>:</h4>
<p>fair :D</p>



<a name="169419130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169419130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169419130">(Jul 01 2019 at 18:27)</a>:</h4>
<p>it's also not on the critical path to anything so you can have as much time as you want :)</p>



<a name="169419150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169419150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169419150">(Jul 01 2019 at 18:27)</a>:</h4>
<p>some of the other things I might do at some point to push ahead <a href="https://github.com/rust-lang/miri/issues/785" target="_blank" title="https://github.com/rust-lang/miri/issues/785">https://github.com/rust-lang/miri/issues/785</a></p>



<a name="169459078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169459078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169459078">(Jul 02 2019 at 07:26)</a>:</h4>
<p>this started when intptrcast landed</p>



<a name="169459079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169459079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169459079">(Jul 02 2019 at 07:26)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> hm... <a href="https://travis-ci.org/RalfJung/miri-test-libstd/builds/553141007?utm_medium=notification&amp;utm_source=email" target="_blank" title="https://travis-ci.org/RalfJung/miri-test-libstd/builds/553141007?utm_medium=notification&amp;utm_source=email">https://travis-ci.org/RalfJung/miri-test-libstd/builds/553141007?utm_medium=notification&amp;utm_source=email</a></p>



<a name="169459090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169459090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169459090">(Jul 02 2019 at 07:27)</a>:</h4>
<p>I'll investigate tonight ;)</p>



<a name="169511456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169511456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169511456">(Jul 02 2019 at 19:25)</a>:</h4>
<p>I started looking at this and here is the trace </p>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, src/librustc_errors/lib.rs:650:9
stack backtrace:
   0: &lt;unknown&gt;
   1: &lt;unknown&gt;
   2: &lt;unknown&gt;
   3: &lt;unknown&gt;
   4: &lt;unknown&gt;
   5: &lt;unknown&gt;
   6: &lt;unknown&gt;
   7: &lt;unknown&gt;
   8: &lt;unknown&gt;
   9: &lt;unknown&gt;
  10: &lt;unknown&gt;
  11: &lt;unknown&gt;
  12: &lt;unknown&gt;
  13: &lt;rustc_mir::interpret::eval_context::InterpretCx&lt;miri::machine::Evaluator&gt; as miri::operator::EvalContextExt&gt;::ptr_op
             at src/operator.rs:0
  14: &lt;miri::machine::Evaluator as rustc_mir::interpret::machine::Machine&gt;::ptr_op
             at src/machine.rs:170
  15: rustc_mir::interpret::operator::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::binary_op
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/operator.rs:309
  16: rustc_mir::interpret::operator::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::binop_ignore_overflow
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/operator.rs:34
  17: rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::eval_rvalue_into_place
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:155
  18: rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::statement
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:85
  19: rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::step
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:61
  20: rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpretCx&lt;M&gt;&gt;::run
             at /Users/christian/Workspace/contrib/rust/src/librustc_mir/interpret/step.rs:40
  21: miri::eval::eval_main::{{closure}}
             at src/eval.rs:185
  22: miri::eval::eval_main
             at src/eval.rs:184
  23: &lt;miri::MiriCompilerCalls as rustc_driver::Callbacks&gt;::after_analysis::{{closure}}
             at src/bin/miri.rs:50
  24: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}::{{closure}}
             at /Users/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
  25: rustc::ty::context::tls::enter_global::{{closure}}
             at /Users/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1963
  26: rustc::ty::context::tls::enter_context::{{closure}}
             at /Users/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1929
  27: rustc::ty::context::tls::set_tlv
             at /Users/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1862
  28: rustc::ty::context::tls::enter_context
             at /Users/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1928
  29: rustc::ty::context::tls::enter_global
             at /Users/christian/Workspace/contrib/rust/src/librustc/ty/context.rs:1962
  30: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}
             at /Users/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
  31: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
             at ./&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:17
  32: &lt;unknown&gt;
  33: alloc::boxed::&lt;impl core::ops::generator::Generator for core::pin::Pin&lt;alloc::boxed::Box&lt;G&gt;&gt;&gt;::resume
             at /Users/christian/Workspace/contrib/rust/src/liballoc/boxed.rs:976
  34: rustc_data_structures::box_region::PinnedGenerator&lt;I,A,R&gt;::access
             at /Users/christian/Workspace/contrib/rust/src/librustc_data_structures/box_region.rs:52
  35: rustc_interface::passes::BoxedGlobalCtxt::access
             at ./&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:19
  36: rustc_interface::passes::BoxedGlobalCtxt::enter
             at /Users/christian/Workspace/contrib/rust/src/librustc_interface/passes.rs:803
  37: &lt;miri::MiriCompilerCalls as rustc_driver::Callbacks&gt;::after_analysis
             at src/bin/miri.rs:43
  38: &lt;unknown&gt;
  39: &lt;unknown&gt;
  40: &lt;unknown&gt;
  41: &lt;unknown&gt;
  42: &lt;unknown&gt;
  43: &lt;unknown&gt;
  44: &lt;unknown&gt;
  45: &lt;unknown&gt;
  46: &lt;unknown&gt;
  47: &lt;unknown&gt;
  48: &lt;unknown&gt;
  49: &lt;unknown&gt;
query stack during panic:
end of query stack
error: aborting due to previous error
</pre></div>



<a name="169511538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169511538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169511538">(Jul 02 2019 at 19:26)</a>:</h4>
<p>So, it seems this is happening because <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/interpret/operator.rs#L309" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/interpret/operator.rs#L309">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/interpret/operator.rs#L309</a></p>



<a name="169511559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169511559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169511559">(Jul 02 2019 at 19:26)</a>:</h4>
<p>Was not that the change that we decided to not make at the end?</p>



<a name="169512368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169512368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169512368">(Jul 02 2019 at 19:37)</a>:</h4>
<p>theres some crucial debug info missing from that trace</p>



<a name="169512375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169512375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169512375">(Jul 02 2019 at 19:37)</a>:</h4>
<p>like where in Miri this goes on^^</p>



<a name="169512384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169512384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169512384">(Jul 02 2019 at 19:37)</a>:</h4>
<p>I can get you the miri log</p>



<a name="169512386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169512386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169512386">(Jul 02 2019 at 19:37)</a>:</h4>
<p><code>src/operator.rs:0</code> :/</p>



<a name="169521557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169521557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169521557">(Jul 02 2019 at 21:39)</a>:</h4>
<p><em>oh</em> I know whats going on</p>



<a name="169521567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169521567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169521567">(Jul 02 2019 at 21:40)</a>:</h4>
<p>its fat ptr comparison</p>



<a name="169521607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169521607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169521607">(Jul 02 2019 at 21:40)</a>:</h4>
<p><em>again</em></p>



<a name="169521635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169521635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169521635">(Jul 02 2019 at 21:40)</a>:</h4>
<p>we cant do <code>to_scalar</code> for <code>Eq</code> and friends</p>



<a name="169521699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169521699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169521699">(Jul 02 2019 at 21:41)</a>:</h4>
<p>I'll think about a fix... tomorrow^^</p>



<a name="169590711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169590711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169590711">(Jul 03 2019 at 18:27)</a>:</h4>
<p>The version is just the commit hash, right?</p>



<a name="169591086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169591086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169591086">(Jul 03 2019 at 18:32)</a>:</h4>
<p>yes</p>



<a name="169591311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169591311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169591311">(Jul 03 2019 at 18:35)</a>:</h4>
<p>How come <code>std::mem::transmute</code> is being affected by the changes on explicit casts?</p>



<a name="169592442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169592442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169592442">(Jul 03 2019 at 18:48)</a>:</h4>
<p>I thought <code>transmute</code> was an intrinsic</p>



<a name="169599424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169599424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169599424">(Jul 03 2019 at 20:25)</a>:</h4>
<p>I have no idea</p>



<a name="169599443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169599443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169599443">(Jul 03 2019 at 20:25)</a>:</h4>
<p>its likely a change in program state earlier that only surfaces there</p>



<a name="169601731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169601731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169601731">(Jul 03 2019 at 20:58)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> found one more nit^^ can you accept the suggestion at <a href="https://github.com/rust-lang/miri/pull/803#discussion_r300141552" target="_blank" title="https://github.com/rust-lang/miri/pull/803#discussion_r300141552">https://github.com/rust-lang/miri/pull/803#discussion_r300141552</a> ? Then I'll r+ for real.</p>



<a name="169601829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169601829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169601829">(Jul 03 2019 at 21:00)</a>:</h4>
<p>it is done</p>



<a name="169601868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169601868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169601868">(Jul 03 2019 at 21:00)</a>:</h4>
<p>thanks!</p>



<a name="169602125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602125">(Jul 03 2019 at 21:05)</a>:</h4>
<p>It is good to see all those PRs advancing :P However I'm really curious about the <code>transmute</code> issue</p>



<a name="169602709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602709">(Jul 03 2019 at 21:13)</a>:</h4>
<p>uh... looks like the issue also occurs in Miri itself: <a href="https://travis-ci.com/rust-lang/miri/jobs/213103563" target="_blank" title="https://travis-ci.com/rust-lang/miri/jobs/213103563">https://travis-ci.com/rust-lang/miri/jobs/213103563</a></p>



<a name="169602769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602769">(Jul 03 2019 at 21:14)</a>:</h4>
<p>Yep, I wrote that in the PR comment</p>



<a name="169602770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602770">(Jul 03 2019 at 21:14)</a>:</h4>
<p>so either something went wrong when you tested it, or something else changed, or you get caught up in the fact that we now are testing way more code with intrptrcast enabled</p>



<a name="169602792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602792">(Jul 03 2019 at 21:15)</a>:</h4>
<p>(we are now running basically the entire miri test suite with and without intptrcast, to get better coverage. that uncovered some issues, most of which I fixed with <a href="https://github.com/rust-lang/miri/pull/820" target="_blank" title="https://github.com/rust-lang/miri/pull/820">https://github.com/rust-lang/miri/pull/820</a>)</p>



<a name="169602812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602812">(Jul 03 2019 at 21:15)</a>:</h4>
<p>I remember that the miri tests passed in local with a custom rustc build with intptrcast for casts enabled</p>



<a name="169602825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602825">(Jul 03 2019 at 21:15)</a>:</h4>
<p>Including the ones that are failing now</p>



<a name="169602886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602886">(Jul 03 2019 at 21:16)</a>:</h4>
<p>those probably only ran with intrptrcast disabled back then</p>



<a name="169602898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602898">(Jul 03 2019 at 21:16)</a>:</h4>
<p>i.e., our test suite was not good for finding intptrcast issues</p>



<a name="169602900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602900">(Jul 03 2019 at 21:16)</a>:</h4>
<p>now it is better at that :D</p>



<a name="169602902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602902">(Jul 03 2019 at 21:16)</a>:</h4>
<p>:P</p>



<a name="169602910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602910">(Jul 03 2019 at 21:16)</a>:</h4>
<p>Well, how do we start looking into this one?</p>



<a name="169602938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602938">(Jul 03 2019 at 21:17)</a>:</h4>
<p>it's a validation failure, for function types</p>



<a name="169602952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169602952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169602952">(Jul 03 2019 at 21:17)</a>:</h4>
<p>the code for that is in rustc, <code>librustc_mit/interpret/validation.rs</code> or so</p>



<a name="169603018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603018">(Jul 03 2019 at 21:18)</a>:</h4>
<p>oh actually this looks very familiar</p>



<a name="169603020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603020">(Jul 03 2019 at 21:18)</a>:</h4>
<p>I think one of my in-flight PRs fixes this</p>



<a name="169603048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603048">(Jul 03 2019 at 21:18)</a>:</h4>
<p>namely, <a href="https://github.com/rust-lang/rust/pull/62245" target="_blank" title="https://github.com/rust-lang/rust/pull/62245">https://github.com/rust-lang/rust/pull/62245</a></p>



<a name="169603081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603081">(Jul 03 2019 at 21:19)</a>:</h4>
<p>concretely, <a href="https://github.com/rust-lang/rust/pull/62245/files#diff-269a7510489262b796ff39a89b2dbdc2R459" target="_blank" title="https://github.com/rust-lang/rust/pull/62245/files#diff-269a7510489262b796ff39a89b2dbdc2R459">this change</a></p>



<a name="169603092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603092">(Jul 03 2019 at 21:19)</a>:</h4>
<p>If you want I could fetch your changes and test what happens</p>



<a name="169603104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603104">(Jul 03 2019 at 21:19)</a>:</h4>
<p>it's basically a missing <code>force_ptr</code></p>



<a name="169603105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603105">(Jul 03 2019 at 21:19)</a>:</h4>
<p>sure, why not</p>



<a name="169603107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603107">(Jul 03 2019 at 21:19)</a>:</h4>
<p>I am going to go to sleep now ;)</p>



<a name="169603112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603112">(Jul 03 2019 at 21:19)</a>:</h4>
<p>Sure, sleep tight :P</p>



<a name="169603175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169603175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169603175">(Jul 03 2019 at 21:20)</a>:</h4>
<p>you could submit an emergency fix that replaces the <code>to_ptr</code> there with a <code>force_ptr</code>... but probably it makes more sense to wait for my thing to land, hoping review won't take too long</p>



<a name="169659823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169659823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169659823">(Jul 04 2019 at 16:38)</a>:</h4>
<p>Hi @RalfJ, what changes does your PR has that fix the bug with transmute?</p>



<a name="169672273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169672273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169672273">(Jul 04 2019 at 21:42)</a>:</h4>
<p>quoting myself:</p>
<blockquote>
<p>namely, <a href="https://github.com/rust-lang/rust/pull/62245/files#diff-269a7510489262b796ff39a89b2dbdc2R459" target="_blank" title="https://github.com/rust-lang/rust/pull/62245/files#diff-269a7510489262b796ff39a89b2dbdc2R459">this change</a></p>
</blockquote>



<a name="169711881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169711881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169711881">(Jul 05 2019 at 14:15)</a>:</h4>
<p>Should I continue with the partial reads? or should I wait for the current problems with casting to be solved?</p>



<a name="169725642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/169725642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#169725642">(Jul 05 2019 at 17:57)</a>:</h4>
<p>(sorry I'll be on low-communication mode for a week. important deadline coming up.)</p>



<a name="170901111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170901111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170901111">(Jul 15 2019 at 15:03)</a>:</h4>
<p>I have a couple of questions</p>



<a name="170901273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170901273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170901273">(Jul 15 2019 at 15:04)</a>:</h4>
<p>(when) should we revert the changes done by <span class="user-mention" data-user-id="120791">@RalfJ</span>  in <a href="https://github.com/rust-lang/miri/pull/803" target="_blank" title="https://github.com/rust-lang/miri/pull/803">https://github.com/rust-lang/miri/pull/803</a>?</p>



<a name="170901916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170901916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170901916">(Jul 15 2019 at 15:12)</a>:</h4>
<p>And the second one is about:</p>
<blockquote>
<p>it means that when reading memory you cant just look at the <code>bytes</code>, you have to consider the <code>relocations</code> as well</p>
</blockquote>
<p>this means that <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330">https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330</a> needs to be changed?</p>



<a name="170980802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170980802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170980802">(Jul 16 2019 at 12:32)</a>:</h4>
<blockquote>
<p>(when) should we revert the changes done by <span class="user-mention silent" data-user-id="120791">RalfJ</span>  in <a href="https://github.com/rust-lang/miri/pull/803" target="_blank" title="https://github.com/rust-lang/miri/pull/803">https://github.com/rust-lang/miri/pull/803</a>?</p>
</blockquote>
<p>they have all been reverted already :)</p>



<a name="170980916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170980916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170980916">(Jul 16 2019 at 12:34)</a>:</h4>
<blockquote>
<p>And the second one is about:</p>
<blockquote>
<p>it means that when reading memory you cant just look at the <code>bytes</code>, you have to consider the <code>relocations</code> as well</p>
</blockquote>
<p>this means that <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330">https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L330</a> needs to be changed?</p>
</blockquote>
<p>actually <code>get_bytes_with_undef_and_ptr</code> will likely already need changes. with size=1, that checks that no relocation overlaps with the "edge" of that access, but of course when accessing one byte of a pointer, there <em>will</em> be an overlap</p>



<a name="170997305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/170997305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#170997305">(Jul 16 2019 at 15:27)</a>:</h4>
<p>I'm not sure I'm following</p>



<a name="171002187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002187">(Jul 16 2019 at 16:19)</a>:</h4>
<p>I guess I am not sure what the question is^^</p>



<a name="171002213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002213">(Jul 16 2019 at 16:19)</a>:</h4>
<p>So the question is, what am I supposed to do? :P</p>



<a name="171002338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002338">(Jul 16 2019 at 16:20)</a>:</h4>
<p>I thought that <code>read_target_uint</code> did the reading, but the actual bytes are extracted using <code>get_bytes_with_undef_and_ptr</code>,  right?</p>



<a name="171002525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002525">(Jul 16 2019 at 16:22)</a>:</h4>
<p>I'd say have a good look at <a href="http://alloc.rs" target="_blank" title="http://alloc.rs">alloc.rs</a> and read the doc comments on what you find there, that should help understand how things are organized</p>



<a name="171002540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002540">(Jul 16 2019 at 16:22)</a>:</h4>
<p><code>get_bytes_with_undef_and_ptr</code> does some "preliminary checking" and then returns a byte slice</p>



<a name="171002548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002548">(Jul 16 2019 at 16:22)</a>:</h4>
<p>it is an internal helper function</p>



<a name="171002580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002580">(Jul 16 2019 at 16:23)</a>:</h4>
<p>did we have a testcase already that this change is supposed to make work? IMO that's always a good way to start for a new feature :)</p>



<a name="171002591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002591">(Jul 16 2019 at 16:23)</a>:</h4>
<blockquote>
<p><code>get_bytes_with_undef_and_ptr</code> does some "preliminary checking" and then returns a byte slice</p>
</blockquote>
<p>but that byte slice contains the actual bytes from the allocation?</p>



<a name="171002599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002599">(Jul 16 2019 at 16:23)</a>:</h4>
<blockquote>
<p>did we have a testcase already that this change is supposed to make work? IMO that's always a good way to start for a new feature :)</p>
</blockquote>
<p>yes, your ptr to ptr cast example</p>



<a name="171002684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002684">(Jul 16 2019 at 16:24)</a>:</h4>
<blockquote>
<p>but that byte slice contains the actual bytes from the allocation?</p>
</blockquote>
<p>right. it does <em>not</em> contain the relocations.</p>



<a name="171002719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002719">(Jul 16 2019 at 16:24)</a>:</h4>
<p>there is also <code>get_bytes</code>, try understanding the difference between that and <code>get_bytes_with_undef_and_ptr</code> (the latter does fewer checks, expects the caller to make them)</p>



<a name="171002721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002721">(Jul 16 2019 at 16:24)</a>:</h4>
<blockquote>
<blockquote>
<p>but that byte slice contains the actual bytes from the allocation?</p>
</blockquote>
<p>right. it does <em>not</em> contain the relocations.</p>
</blockquote>
<p>So in the case of a pointer allocation it just has the offset</p>



<a name="171002726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002726">(Jul 16 2019 at 16:24)</a>:</h4>
<p>yes</p>



<a name="171002758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002758">(Jul 16 2019 at 16:25)</a>:</h4>
<blockquote>
<p>yes, your ptr to ptr cast example</p>
</blockquote>
<p>great! try to understand where exactly in <code>alloc.rs</code> the error is raised</p>



<a name="171002767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002767">(Jul 16 2019 at 16:25)</a>:</h4>
<p>clearly that's code that has to change :D</p>



<a name="171002772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002772">(Jul 16 2019 at 16:25)</a>:</h4>
<p>hahahahaha</p>



<a name="171002963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171002963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171002963">(Jul 16 2019 at 16:27)</a>:</h4>
<p>Ok I'm going to sync my fork with master and compile rustc to start messing with it</p>



<a name="171003124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171003124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171003124">(Jul 16 2019 at 16:28)</a>:</h4>
<p>ah that reminds me I should check why miri does not build on master</p>



<a name="171003150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171003150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171003150">(Jul 16 2019 at 16:29)</a>:</h4>
<p>maybe better sync with the version in <a href="https://github.com/rust-lang/miri/blob/master/rust-version" target="_blank" title="https://github.com/rust-lang/miri/blob/master/rust-version">https://github.com/rust-lang/miri/blob/master/rust-version</a> :D</p>



<a name="171004095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171004095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171004095">(Jul 16 2019 at 16:39)</a>:</h4>
<p>ah, it just affects 2 compile-fail tests. doesn't matter much.</p>



<a name="171004202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171004202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171004202">(Jul 16 2019 at 16:40)</a>:</h4>
<p>oh</p>



<a name="171004237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171004237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171004237">(Jul 16 2019 at 16:40)</a>:</h4>
<p>well anyway I had to do the changes over master eventually, so I believe i can live with those 2 tests failing</p>



<a name="171005275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171005275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171005275">(Jul 16 2019 at 16:53)</a>:</h4>
<p>sure</p>



<a name="171082551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171082551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171082551">(Jul 17 2019 at 14:21)</a>:</h4>
<p>I started looking how <code>Allocations</code> work. I believe the docs for <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.UndefMask.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.UndefMask.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/struct.UndefMask.html</a> could use some love (I could do that as a side task)</p>



<a name="171085862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171085862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171085862">(Jul 17 2019 at 14:59)</a>:</h4>
<p><span aria-label="embarrassed" class="emoji emoji-1f633" role="img" title="embarrassed">:embarrassed:</span></p>



<a name="171085907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171085907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171085907">(Jul 17 2019 at 14:59)</a>:</h4>
<p>Or maybe it's not so useful IDK</p>



<a name="171085914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171085914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171085914">(Jul 17 2019 at 14:59)</a>:</h4>
<p>UndefMask is magic</p>



<a name="171085982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171085982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171085982">(Jul 17 2019 at 15:00)</a>:</h4>
<p>It def needs some docs</p>



<a name="171086154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171086154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171086154">(Jul 17 2019 at 15:01)</a>:</h4>
<p>I've been studying how to handle bitvectors to learn about compression so I'm in the mood right now hahaha</p>



<a name="171087017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171087017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171087017">(Jul 17 2019 at 15:11)</a>:</h4>
<p>Is there a reason to not use the <code>BitSet</code> from <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/bit_set/index.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/bit_set/index.html">data_structures::bit_set</a>? In any case, <span class="user-mention" data-user-id="120791">@RalfJ</span> suggested changing the name to <code>init_mask</code> to remove unfortunate name collision with the meaning of <code>undef</code> (which is not <code>uninit()</code> at all) in llvm.</p>



<a name="171087383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171087383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171087383">(Jul 17 2019 at 15:14)</a>:</h4>
<p>Idk if BitSet is as optimized as UndefMask</p>



<a name="171095471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171095471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171095471">(Jul 17 2019 at 16:52)</a>:</h4>
<p>I'll put in on my list anyway to do it later</p>



<a name="171096715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171096715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171096715">(Jul 17 2019 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="229913">@Andreas Molzer</span> no idea. <code>UndefMask</code> predates me.^^</p>



<a name="171096887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171096887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171096887">(Jul 17 2019 at 17:11)</a>:</h4>
<p>SoOooOOoo, I started reading why the ptr to ptr cast fails</p>



<a name="171096893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171096893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171096893">(Jul 17 2019 at 17:11)</a>:</h4>
<p>well not the cast per se, the example</p>



<a name="171096974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171096974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171096974">(Jul 17 2019 at 17:12)</a>:</h4>
<p><code>read_scalar</code> fails because <code>get_bytes_with_undef_and_ptr</code> fails (just like <span class="user-mention" data-user-id="120791">@RalfJ</span> said)</p>



<a name="171097152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171097152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171097152">(Jul 17 2019 at 17:14)</a>:</h4>
<p>but at the end <code>get_bytes_with_undef_and_ptr</code> is just calling <code>get_bytes_internal</code> deciding to not fail when reading undefined or pointer bytes</p>



<a name="171097197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171097197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171097197">(Jul 17 2019 at 17:15)</a>:</h4>
<p>except when there are relocations on the <em>edges</em> (And now I'm going to check that)</p>



<a name="171097321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171097321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171097321">(Jul 17 2019 at 17:16)</a>:</h4>
<p>is this failing because reading the whole pointer in this case reads the relocation that its on the edge ?(Given that the vec just has one <code>u64</code>)</p>



<a name="171097526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171097526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171097526">(Jul 17 2019 at 17:18)</a>:</h4>
<blockquote>
<p>except when there are relocations on the <em>edges</em> (And now I'm going to check that)</p>
</blockquote>
<p>yes</p>



<a name="171097737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171097737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171097737">(Jul 17 2019 at 17:21)</a>:</h4>
<p>I suppose that the relocation for a ptr is indexed by <code>0</code>, so that's the edge we are concerned about. It is possible that we should omit the check for the other edge?</p>
<p>EDIT: wait</p>



<a name="171098159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171098159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171098159">(Jul 17 2019 at 17:26)</a>:</h4>
<p>what is <code>check_relocation_edges</code> doing here: </p>
<div class="codehilite"><pre><span></span>        self.check_relocations(cx, ptr.offset(size, cx)?, Size::ZERO)?;
</pre></div>


<p>why is offsetting <code>ptr</code> instead of changing the <code>Size::ZERO</code> to go to the other edge?</p>
<p>is the last argument the offset relative to the second argument?</p>



<a name="171175661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171175661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171175661">(Jul 18 2019 at 14:31)</a>:</h4>
<p>Why is this check needed? I mean, why is it important to not have relocations on the edges of <code>bytes</code>?</p>



<a name="171176183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176183">(Jul 18 2019 at 14:36)</a>:</h4>
<p>I removed the check just to see what would happen and the example still fails in the same way. However, I am not sure where it is failing, here is the relevant part of the stack backtrace:</p>
<div class="codehilite"><pre><span></span>   0: backtrace::backtrace::trace::h52c09578e3caae4d (0x10a97e0b0)
             at /Users/christian/Workspace/contrib/rust/src/libcore/ptr/mod.rs:175
   1: backtrace::capture::Backtrace::new_unresolved::h60dd95aa9bbe6e2e (0x10a97bae8)
             at /Users/christian/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/capture.rs:176
   2: &lt;rustc::mir::interpret::error::InterpErrorInfo as core::convert::From&lt;rustc::mir::interpret::error::InterpError&lt;u64&gt;&gt;&gt;::from::h24fa728fd84817af (0x10a76905d)
             at /Users/christian/Workspace/contrib/rust/src/librustc/mir/interpret/error.rs:212
   3: rustc::mir::interpret::allocation::Allocation&lt;Tag,Extra&gt;::get_bytes_with_undef_and_ptr::h798a0727dc8638da (0x1076f1552)
             at /Users/christian/Workspace/contrib/rust/src/librustc/mir/interpret/mod.rs:5
   4: rustc::mir::interpret::allocation::Allocation&lt;Tag,Extra&gt;::read_scalar::ha577046c19e8cf4e (0x1076ed7b2)
             at /Users/christian/Workspace/contrib/rust/src/librustc/mir/interpret/allocation.rs:321
   5: rustc_mir::interpret::operand::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::try_read_immediate::hb3114fb259748d70 (0x1075e0694)
</pre></div>


<p>So, from <code>3</code> we know that <code>get_bytes_with_undef_and_ptr</code>is still failing but then the trace goes into the error handling.</p>



<a name="171176613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176613">(Jul 18 2019 at 14:40)</a>:</h4>
<p>if you just remove the check, programs will just do utter garbage^^</p>



<a name="171176662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176662">(Jul 18 2019 at 14:41)</a>:</h4>
<p>they would read (parts of) the offset of a pointer and interpret that as raw bytes</p>



<a name="171176668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176668">(Jul 18 2019 at 14:41)</a>:</h4>
<p>how does that make any sense?</p>



<a name="171176671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176671">(Jul 18 2019 at 14:41)</a>:</h4>
<blockquote>
<p>if you just remove the check, programs will just do utter garbage^^</p>
</blockquote>
<p>I am just testing to see what happens</p>



<a name="171176874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171176874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171176874">(Jul 18 2019 at 14:43)</a>:</h4>
<blockquote>
<p>they would read (parts of) the offset of a pointer and interpret that as raw bytes</p>
</blockquote>
<p>Wait, so the only purpose of checking for relocation in the edges is to check if the edges are just ptr offsets?</p>



<a name="171181623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181623">(Jul 18 2019 at 15:33)</a>:</h4>
<p>remember: the data stored in <code>bytes</code> is <em>not</em> the actual content of memory when there is a relocation!</p>



<a name="171181638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181638">(Jul 18 2019 at 15:33)</a>:</h4>
<p>it's just the offset part of the pointer</p>



<a name="171181656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181656">(Jul 18 2019 at 15:33)</a>:</h4>
<p>so the code makes sure that we never ever read stuff from <code>bytes</code> that has a relocation</p>



<a name="171181682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181682">(Jul 18 2019 at 15:33)</a>:</h4>
<p>but the only stuff from <code>bytes</code> with relocations should be pointer offsets, right?</p>



<a name="171181683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181683">(Jul 18 2019 at 15:33)</a>:</h4>
<p>and if there is a relocation at index 4 in the allocation, reading the byte at index 6 <em>does</em> overlap</p>



<a name="171181846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171181846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171181846">(Jul 18 2019 at 15:35)</a>:</h4>
<p>Oh wait so when we are talking about <em>edges</em>, we are talking about the edges of a concrete region in <code>bytes</code>, not the whole vector</p>



<a name="171183139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183139">(Jul 18 2019 at 15:48)</a>:</h4>
<p>yes</p>



<a name="171183144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183144">(Jul 18 2019 at 15:48)</a>:</h4>
<p>we need pictures :/</p>



<a name="171183239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183239">(Jul 18 2019 at 15:49)</a>:</h4>
<p>so if an access reads from bytes 4..8, then we have to make sure that none of the bytes in there "have" a relocation</p>



<a name="171183292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183292">(Jul 18 2019 at 15:49)</a>:</h4>
<p>to "have" a relocation means that this byte is part of the <code>offset</code> of some pointer. this means that there exists a relocation at index I such that this byte is at index I+N where N in <code>0..8</code>.</p>



<a name="171183325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183325">(Jul 18 2019 at 15:49)</a>:</h4>
<p>so e.g. if there is a relocation at index 4, the bytes 4..12 "have" a relocation</p>



<a name="171183404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183404">(Jul 18 2019 at 15:50)</a>:</h4>
<p>the way we check this is in two parts: think about each relocation being a "range", and the access being a "range"</p>



<a name="171183421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183421">(Jul 18 2019 at 15:50)</a>:</h4>
<p>we first check if the "edges" of the access are "inside" a relocation range</p>



<a name="171183439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183439">(Jul 18 2019 at 15:50)</a>:</h4>
<p>and then we check if there is a relocation entirely "inside" the "access range"</p>



<a name="171183473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183473">(Jul 18 2019 at 15:51)</a>:</h4>
<p>the reason that the latter case is different is that it actually is allowed when you read a pointer! the former case (at the edges) is never allowed <em>currently</em></p>



<a name="171183479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171183479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171183479">(Jul 18 2019 at 15:51)</a>:</h4>
<p>does this make sense?</p>



<a name="171184080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171184080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171184080">(Jul 18 2019 at 15:57)</a>:</h4>
<blockquote>
<p>we need pictures :/</p>
</blockquote>
<p>Let me get my whiteboard</p>



<a name="171185021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171185021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171185021">(Jul 18 2019 at 16:07)</a>:</h4>
<p>Oh ok</p>



<a name="171185263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171185263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171185263">(Jul 18 2019 at 16:10)</a>:</h4>
<blockquote>
<p>we first check if the "edges" of the access are "inside" a relocation range</p>
</blockquote>
<p>This is an illegal access because this would mean you are reading some (but not all) of the bytes from the pointer offset.</p>
<blockquote>
<p>and then we check if there is a relocation entirely "inside" the "access range"</p>
</blockquote>
<p>This is fine because you are actually reading the whole offset and not just some part of it</p>



<a name="171235751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171235751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171235751">(Jul 19 2019 at 07:21)</a>:</h4>
<blockquote>
<blockquote>
<p>we first check if the "edges" of the access are "inside" a relocation range</p>
</blockquote>
<p>This is an illegal access because this would mean you are reading some (but not all) of the bytes from the pointer offset.</p>
</blockquote>
<p>correct</p>



<a name="171235792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171235792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171235792">(Jul 19 2019 at 07:22)</a>:</h4>
<blockquote>
<p>This is fine because you are actually reading the whole offset and not just some part of it</p>
</blockquote>
<p>This is fine only because <code>read_scalar</code> <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L336" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L336">contains special code to handle relocations</a>!</p>



<a name="171235793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171235793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171235793">(Jul 19 2019 at 07:22)</a>:</h4>
<p>otherwise it would still return the offset as raw bytes, which is never correct</p>



<a name="171236269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171236269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171236269">(Jul 19 2019 at 07:32)</a>:</h4>
<blockquote>
<blockquote>
<p>This is fine because you are actually reading the whole offset and not just some part of it</p>
</blockquote>
<p>This is fine only because <code>read_scalar</code> <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L336" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc/mir/interpret/allocation.rs#L336">contains special code to handle relocations</a>!</p>
</blockquote>
<p>So it creates an actual pointer from the bytes containing the offset</p>



<a name="171236274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171236274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171236274">(Jul 19 2019 at 07:32)</a>:</h4>
<p>and the information in the relocations of course</p>



<a name="171236947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171236947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171236947">(Jul 19 2019 at 07:47)</a>:</h4>
<p>So let me recapitulate a little</p>



<a name="171237150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171237150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171237150">(Jul 19 2019 at 07:51)</a>:</h4>
<p>The ptr to ptr cast is a noop, actually the problem is the dereferencing of such pointer because that  calls <code>read_scalar</code>.</p>



<a name="171237671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171237671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171237671">(Jul 19 2019 at 08:01)</a>:</h4>
<p><code>read_scalar</code> currently fails because <code>get_bytes_internal</code> fails and this last method checks that we access the bytes of a pointer in a proper way</p>



<a name="171248711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171248711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171248711">(Jul 19 2019 at 11:15)</a>:</h4>
<p>not sure what you refer to with the "ptr to ptr cast" here, but otherwise -- yes</p>



<a name="171260013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171260013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171260013">(Jul 19 2019 at 14:06)</a>:</h4>
<blockquote>
<p>not sure what you refer to with the "ptr to ptr cast" here, but otherwise -- yes</p>
</blockquote>
<p>Oh I mean, in your example you are casting a pointer to a pointer.</p>



<a name="171260771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171260771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171260771">(Jul 19 2019 at 14:15)</a>:</h4>
<p>I believe there is something else is failing because when I tried to disable the edges (<a href="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166">https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166</a>) check just to see what would happen when I ran your example, I got an error in <code>get_bytes_with_undef_and_ptr</code> anyway</p>



<a name="171265159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171265159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171265159">(Jul 19 2019 at 15:06)</a>:</h4>
<p>There is just one different check done and it is the <code>AllocationExtra</code> check, but that's just related to stacked borrows, right?</p>



<a name="171325454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171325454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171325454">(Jul 20 2019 at 12:23)</a>:</h4>
<blockquote>
<p>Oh I mean, in your example you are casting a pointer to a pointer.</p>
</blockquote>
<p>ah, but that's just to be able to do a 1-byte access that loads part of a pointer value</p>



<a name="171325500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171325500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171325500">(Jul 20 2019 at 12:24)</a>:</h4>
<blockquote>
<p>I believe there is something else is failing because when I tried to disable the edges (<a href="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166">https://github.com/rust-lang/rust/blob/master/src/librustc/mir/interpret/allocation.rs#L166</a>) check just to see what would happen when I ran your example, I got an error in <code>get_bytes_with_undef_and_ptr</code> anyway</p>
</blockquote>
<p>probably the "interior relocation" check fired?</p>



<a name="171325506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171325506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171325506">(Jul 20 2019 at 12:24)</a>:</h4>
<p>that one is at <a href="https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334" target="_blank" title="https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334">https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334</a></p>



<a name="171335796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171335796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171335796">(Jul 20 2019 at 17:36)</a>:</h4>
<blockquote>
<p>that one is at <a href="https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334" target="_blank" title="https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334">https://github.com/rust-lang/rust/blob/f69b07144a151f46aaee1b6230ba4160e9394562/src/librustc/mir/interpret/allocation.rs#L334</a></p>
</blockquote>
<p>But the error is still inside <code>get_bytes_with_undef_and_ptr</code></p>



<a name="171336000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171336000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171336000">(Jul 20 2019 at 17:42)</a>:</h4>
<p>In fact I don't know, let me retry</p>



<a name="171342001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171342001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171342001">(Jul 20 2019 at 20:47)</a>:</h4>
<p>where exactly is it?</p>



<a name="171346322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171346322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171346322">(Jul 20 2019 at 23:13)</a>:</h4>
<p>exactly where you said, It took a while to recompile</p>



<a name="171443763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171443763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171443763">(Jul 22 2019 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>, I would like to ask you something. When we do the partial read, shouldn't we read the whole pointer and then do the proper handling of the partial read?</p>



<a name="171443797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171443797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171443797">(Jul 22 2019 at 16:07)</a>:</h4>
<p>If I understood correctly, right now rust is trying to access partially the pointer and that is why the edges check is failing.</p>



<a name="171501495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171501495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171501495">(Jul 23 2019 at 09:08)</a>:</h4>
<p>yeah, you will have to read the entire<code>offset</code> at least, cast it to int, and then extract the correct sub-range from that</p>



<a name="171524593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171524593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171524593">(Jul 23 2019 at 14:38)</a>:</h4>
<p>so I need to change <code>get_bytes_with_undef_and_ptr</code>? or should I change the parameters for <code>read_scalar</code></p>



<a name="171559759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171559759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171559759">(Jul 23 2019 at 21:31)</a>:</h4>
<p>TBH for this one I dont have a complete strategy in my mind, I thought I'd let you figure something out?<br>
my gut feeling is: make <code>get_bytes_with_undef_and_ptr</code> not check for edges, <em>carefully review all existing users and add the edge check there</em>, and then the rest can be done locally in <code>read_scalar</code></p>



<a name="171610509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171610509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171610509">(Jul 24 2019 at 14:26)</a>:</h4>
<p>I could modify <code>get_bytes_with_undef_and_ptr</code> to have a parameter to decide if <em>edges</em> should be checked or not</p>



<a name="171624167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171624167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171624167">(Jul 24 2019 at 17:10)</a>:</h4>
<p>what other places call that method? maybe they should just do the edge check themselves</p>



<a name="171624182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171624182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171624182">(Jul 24 2019 at 17:11)</a>:</h4>
<p>maybe the entire edge-vs-interior distinction just does not make sense any more</p>



<a name="171632254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171632254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171632254">(Jul 24 2019 at 18:47)</a>:</h4>
<blockquote>
<p>what other places call that method? maybe they should just do the edge check themselves</p>
</blockquote>
<p>I'm going to check this in a moment</p>



<a name="171635430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635430">(Jul 24 2019 at 19:28)</a>:</h4>
<p>We have two other places calling that method, so probably doing the check inside each caller is a better idea:<br>
- <a href="https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc_mir/interpret/memory.rs#L811" target="_blank" title="https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc_mir/interpret/memory.rs#L811">https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc_mir/interpret/memory.rs#L811</a><br>
-  <a href="https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc/mir/interpret/allocation.rs#L263" target="_blank" title="https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc/mir/interpret/allocation.rs#L263">https://github.com/rust-lang/rust/blob/27a6a304e2baaabca88059753f020377f2476978/src/librustc/mir/interpret/allocation.rs#L263</a></p>



<a name="171635603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635603">(Jul 24 2019 at 19:30)</a>:</h4>
<p>hm... in principle at least <code>copy</code> should probably also support copying parts of a pointer. but the challenge will be to find a nice interface that makes all of that possible and not messy.</p>



<a name="171635637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635637">(Jul 24 2019 at 19:31)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  eventually we probably want a type like <code>Byte</code> in <a href="https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html" target="_blank" title="https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html">https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html</a> ^^</p>



<a name="171635728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635728">(Jul 24 2019 at 19:32)</a>:</h4>
<p>I'm going to start by migrating the check outside the method and check that nothing blews up.</p>



<a name="171635736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635736">(Jul 24 2019 at 19:32)</a>:</h4>
<p>Does that sounds good to you?</p>



<a name="171635846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171635846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171635846">(Jul 24 2019 at 19:34)</a>:</h4>
<p>sounds good, yes!</p>



<a name="171636609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171636609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171636609">(Jul 24 2019 at 19:44)</a>:</h4>
<p>Ok great! I just did the changes and I'm running the tests</p>



<a name="171641683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171641683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171641683">(Jul 24 2019 at 20:44)</a>:</h4>
<p>Can't we just ptr to int and grab the bytes we need?</p>



<a name="171644676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171644676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171644676">(Jul 24 2019 at 21:26)</a>:</h4>
<p>we dont have a <code>Memory</code> :/</p>



<a name="171644700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171644700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171644700">(Jul 24 2019 at 21:27)</a>:</h4>
<p>Oh, this is in <code>Allocation</code>?</p>



<a name="171644831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171644831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171644831">(Jul 24 2019 at 21:29)</a>:</h4>
<p>Hmm, yea any API that supports it would be a mess or inefficient in the "everything is defined bytes" situation, which is the commkn situation</p>



<a name="171670604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171670604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171670604">(Jul 25 2019 at 07:47)</a>:</h4>
<blockquote>
<p>Oh, this is in <code>Allocation</code>?</p>
</blockquote>
<p>yeah, it's in <code>read_scalar</code></p>



<a name="171670706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171670706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171670706">(Jul 25 2019 at 07:49)</a>:</h4>
<p>I think for a non-hacky solution we probably first need an "intermediate representation" that can actually represent any single byte of memory. That's not how we <em>store</em> memory, but it can be how we <em>access</em> it. So <code>get_bytes</code> would yield an iterator (or take a closure that takes an iterator) of things that are either a <code>u8</code>, or <code>Undef</code>, or "byte n of a <code>Pointer</code>".<br>
or is that overkill?</p>



<a name="171673036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171673036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171673036">(Jul 25 2019 at 08:34)</a>:</h4>
<p>Need some similar thing in llvm codegen as well when <code>bytes</code> etc are to become private. It currently iterates over the relocations and all bytes on its own.</p>



<a name="171673781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171673781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171673781">(Jul 25 2019 at 08:49)</a>:</h4>
<p>it can use <code>get_bytes_with_undef_and_ptr</code> for the bytes</p>



<a name="171673787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171673787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171673787">(Jul 25 2019 at 08:49)</a>:</h4>
<p>and maybe we can open read-only access to the relocations</p>



<a name="171673792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171673792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171673792">(Jul 25 2019 at 08:49)</a>:</h4>
<p>I don't think it needs the "abstract byte" stuff</p>



<a name="171702334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171702334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171702334">(Jul 25 2019 at 15:43)</a>:</h4>
<p>I was able to move the edges check outside <code>get_bytes_with_bla_bla</code>  without blowing up the compiler to smithereens:<br>
<a href="https://github.com/rust-lang/rust/compare/master...christianpoveda:partial-reads?expand=1" target="_blank" title="https://github.com/rust-lang/rust/compare/master...christianpoveda:partial-reads?expand=1">https://github.com/rust-lang/rust/compare/master...christianpoveda:partial-reads?expand=1</a></p>



<a name="171703416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171703416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171703416">(Jul 25 2019 at 15:58)</a>:</h4>
<p>Now I am going to start changing <code>read_scalar</code></p>



<a name="171952464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171952464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171952464">(Jul 29 2019 at 14:54)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>, the <code>size</code> received in <code>read_scalar</code> is the number of bytes we want to read from the pointer?  or the number of bytes we want to read from the  pointee?</p>



<a name="171954138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171954138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171954138">(Jul 29 2019 at 15:11)</a>:</h4>
<p>also I just saw <a href="https://github.com/rust-lang/miri/issues/841" target="_blank" title="https://github.com/rust-lang/miri/issues/841">https://github.com/rust-lang/miri/issues/841</a>, should I freeze partial reads then?</p>



<a name="171956771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171956771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171956771">(Jul 29 2019 at 15:40)</a>:</h4>
<p><span class="user-mention" data-user-id="132916">@Christian Poveda</span> I am confused by that question. it's the number of bytes to be read from memory.</p>



<a name="171956800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171956800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171956800">(Jul 29 2019 at 15:41)</a>:</h4>
<blockquote>
<p>also I just saw <a href="https://github.com/rust-lang/miri/issues/841" target="_blank" title="https://github.com/rust-lang/miri/issues/841">https://github.com/rust-lang/miri/issues/841</a>, should I freeze partial reads then?</p>
</blockquote>
<p>not sure, do you have a concrete plan to proceed? I am not sure yet how feasible my plan in that issue is</p>



<a name="171956960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/171956960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#171956960">(Jul 29 2019 at 15:42)</a>:</h4>
<blockquote>
<blockquote>
<p>also I just saw <a href="https://github.com/rust-lang/miri/issues/841" target="_blank" title="https://github.com/rust-lang/miri/issues/841">https://github.com/rust-lang/miri/issues/841</a>, should I freeze partial reads then?</p>
</blockquote>
<p>not sure, do you have a concrete plan to proceed? I am not sure yet how feasible my plan in that issue is</p>
</blockquote>
<p>Not yet, I am trying to see what happens if I disable the checks inside <code>read_scalar</code></p>



<a name="172047945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172047945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172047945">(Jul 30 2019 at 15:23)</a>:</h4>
<p>I think partial reads might be more than I am able to understand and fix right now.</p>



<a name="172063058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172063058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172063058">(Jul 30 2019 at 18:23)</a>:</h4>
<p>I see. That's okay. You already did a lot for intptrcast :)</p>



<a name="172074289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172074289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172074289">(Jul 30 2019 at 20:38)</a>:</h4>
<p>Is it there anything else that needs to be done?</p>



<a name="172076709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172076709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172076709">(Jul 30 2019 at 21:09)</a>:</h4>
<p>Rust has almost 5k open issues, there's lots to be done. ;) There are <a href="https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AE-mentor" target="_blank" title="https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AE-mentor">"E-mentor"</a> and "E-easy"/"E-medium" labels to find issues where people can guide you.</p>



<a name="172076848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172076848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172076848">(Jul 30 2019 at 21:11)</a>:</h4>
<p>On the Miri side you could scroll through <a href="https://github.com/rust-lang/miri/issues" target="_blank" title="https://github.com/rust-lang/miri/issues">https://github.com/rust-lang/miri/issues</a> and see if anything peeks your interest.<br>
Good issues can probably be found in the A-shims category (<a href="https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims" target="_blank" title="https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims">https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims</a>); those tend to be fairly local and not interact with tons of stuff. Depend on what kind of experience you have elsehwere in the Rust ecosystem, you might like <a href="https://github.com/rust-lang/miri/issues/546" target="_blank" title="https://github.com/rust-lang/miri/issues/546">https://github.com/rust-lang/miri/issues/546</a>. If you want something more open-ended where you will have to do your own research and there's nobody to tell you all the answers, maybe you'll like <a href="https://github.com/rust-lang/miri/issues/739" target="_blank" title="https://github.com/rust-lang/miri/issues/739">https://github.com/rust-lang/miri/issues/739</a>.</p>



<a name="172133358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172133358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172133358">(Jul 31 2019 at 14:40)</a>:</h4>
<p>I meant, is there anything else to do in intptrcast? What about those bullet points: <a href="https://github.com/rust-lang/miri/issues/224#issue-239164007" target="_blank" title="https://github.com/rust-lang/miri/issues/224#issue-239164007">https://github.com/rust-lang/miri/issues/224#issue-239164007</a> ?</p>



<a name="172133496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172133496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172133496">(Jul 31 2019 at 14:42)</a>:</h4>
<p>I suppose " Exploit "real" pointer alignment for alignment checks, but warn when we do.<br>
" is checked by your last comment. What about checking where else to use <code>force_ptr</code>/<code>force_bits</code>?</p>



<a name="172134929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172134929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172134929">(Jul 31 2019 at 14:59)</a>:</h4>
<blockquote>
<p>I suppose " Exploit real pointer alignment for alignment checks, but warn when we do. " is checked by your last comment.</p>
</blockquote>
<p>no it's not. but this first requires coming up with a plan for <a href="https://github.com/rust-lang/miri/issues/797" target="_blank" title="https://github.com/rust-lang/miri/issues/797">https://github.com/rust-lang/miri/issues/797</a>. (or just implementing some hacky first version that can later be rewritten when we have a plan.^^)</p>



<a name="172134974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172134974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172134974">(Jul 31 2019 at 14:59)</a>:</h4>
<p>Ha, ok I would wait</p>



<a name="172134984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172134984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172134984">(Jul 31 2019 at 14:59)</a>:</h4>
<blockquote>
<p>What about checking where else to use force_ptr/force_bits?</p>
</blockquote>
<p>That still needs to be done, but I think it needs someone who has enough experience to look at each and every use site of these methods and figure out which is the right method.</p>



<a name="172135002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135002">(Jul 31 2019 at 15:00)</a>:</h4>
<p>ok</p>



<a name="172135075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135075">(Jul 31 2019 at 15:00)</a>:</h4>
<p>if I end up having to tell you the answer for every call site, it's not really saving any time compared to me doing it myself, I am afraid. ;)</p>



<a name="172135098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135098">(Jul 31 2019 at 15:00)</a>:</h4>
<p>sure</p>



<a name="172135107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135107">(Jul 31 2019 at 15:00)</a>:</h4>
<p>also the way this looks will change with <a href="https://github.com/rust-lang/miri/issues/841" target="_blank" title="https://github.com/rust-lang/miri/issues/841">https://github.com/rust-lang/miri/issues/841</a></p>



<a name="172135340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135340">(Jul 31 2019 at 15:03)</a>:</h4>
<p>Well it seems it is time for me to move on :P</p>



<a name="172135411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172135411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172135411">(Jul 31 2019 at 15:04)</a>:</h4>
<blockquote>
<p>On the Miri side you could scroll through <a href="https://github.com/rust-lang/miri/issues" target="_blank" title="https://github.com/rust-lang/miri/issues">https://github.com/rust-lang/miri/issues</a> and see if anything peeks your interest.<br>
Good issues can probably be found in the A-shims category (<a href="https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims" target="_blank" title="https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims">https://github.com/rust-lang/miri/issues?q=is%3Aissue+is%3Aopen+label%3AA-shims</a>); those tend to be fairly local and not interact with tons of stuff. Depend on what kind of experience you have elsehwere in the Rust ecosystem, you might like <a href="https://github.com/rust-lang/miri/issues/546" target="_blank" title="https://github.com/rust-lang/miri/issues/546">https://github.com/rust-lang/miri/issues/546</a>. If you want something more open-ended where you will have to do your own research and there's nobody to tell you all the answers, maybe you'll like <a href="https://github.com/rust-lang/miri/issues/739" target="_blank" title="https://github.com/rust-lang/miri/issues/739">https://github.com/rust-lang/miri/issues/739</a>.</p>
</blockquote>
<p>I'll check something here later</p>



<a name="172145323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172145323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172145323">(Jul 31 2019 at 17:12)</a>:</h4>
<blockquote>
<p>Well it seems it is time for me to move on :P</p>
</blockquote>
<p>thanks a lot for your help with intptrcast, this helped move Miri to a whole new level :)</p>



<a name="172159603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172159603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172159603">(Jul 31 2019 at 19:53)</a>:</h4>
<p>Keep me informed if some new developments happen for intptrcast, I'll be more than happy to help :)</p>



<a name="172166410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/intptrcast%20model/near/172166410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/intptrcast.20model.html#172166410">(Jul 31 2019 at 21:12)</a>:</h4>
<p>will do :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>